@consta/uikit 5.0.0 → 5.0.2

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.
Files changed (34) hide show
  1. package/__internal__/src/components/Checkbox/Checkbox.js +1 -1
  2. package/__internal__/src/components/Checkbox/Checkbox.js.map +1 -1
  3. package/__internal__/src/components/Radio/Radio.js +1 -1
  4. package/__internal__/src/components/Radio/Radio.js.map +1 -1
  5. package/__internal__/src/components/SelectComponents/SelectCreateButton/SelectCreateButton.js +1 -1
  6. package/__internal__/src/components/SelectComponents/SelectCreateButton/SelectCreateButton.js.map +1 -1
  7. package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js +1 -1
  8. package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js.map +1 -1
  9. package/__internal__/src/components/SelectComponents/SelectItem/SelectItem.js +1 -1
  10. package/__internal__/src/components/SelectComponents/SelectItem/SelectItem.js.map +1 -1
  11. package/__internal__/src/components/SelectComponents/SelectItemAll/SelectItemAll.js +2 -0
  12. package/__internal__/src/components/SelectComponents/SelectItemAll/SelectItemAll.js.map +1 -0
  13. package/__internal__/src/components/SelectComponents/SelectItemAll/index.d.ts +1 -1
  14. package/__internal__/src/components/SelectComponents/SelectItemAll/index.js +1 -1
  15. package/__internal__/src/components/SelectComponents/SelectItemAll/index.js.map +1 -1
  16. package/__internal__/src/components/SelectComponents/SelectLoader/SelectLoader.js +1 -1
  17. package/__internal__/src/components/SelectComponents/SelectLoader/SelectLoader.js.map +1 -1
  18. package/__internal__/src/components/SelectComponents/SelectValueTag/SelectValueTag.js +1 -1
  19. package/__internal__/src/components/SelectComponents/SelectValueTag/SelectValueTag.js.map +1 -1
  20. package/__internal__/src/components/Switch/Switch.js +1 -1
  21. package/__internal__/src/components/Switch/Switch.js.map +1 -1
  22. package/__internal__/src/components/Switch/types.d.ts +1 -0
  23. package/__internal__/src/components/Switch/types.js +1 -1
  24. package/__internal__/src/components/Switch/types.js.map +1 -1
  25. package/__internal__/src/components/UserSelect/UserSelectItem/UserSelectItem.css +1 -1
  26. package/__internal__/src/components/UserSelect/UserSelectItem/UserSelectItem.js +1 -1
  27. package/__internal__/src/components/UserSelect/UserSelectItem/UserSelectItem.js.map +1 -1
  28. package/__internal__/src/components/UserSelect/UserSelectValue/UserSelectValue.css +1 -1
  29. package/__internal__/src/components/UserSelect/UserSelectValue/UserSelectValue.js +1 -1
  30. package/__internal__/src/components/UserSelect/UserSelectValue/UserSelectValue.js.map +1 -1
  31. package/package.json +2 -2
  32. package/__internal__/src/components/SelectComponents/SelectItemAll/SelectSelectAll.js +0 -2
  33. package/__internal__/src/components/SelectComponents/SelectItemAll/SelectSelectAll.js.map +0 -1
  34. /package/__internal__/src/components/SelectComponents/SelectItemAll/{SelectSelectAll.d.ts → SelectItemAll.d.ts} +0 -0
@@ -1,2 +1,2 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","name","size","view","align","disabled","intermediate","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputId","inputRef"];import"./Checkbox.css";import React from"react";import{useForkRef}from"../../hooks/useForkRef/useForkRef";import{cnMixFocus}from"../../mixs/MixFocus/MixFocus";import{cn}from"../../utils/bem";import{usePropsHandler}from"../EventInterceptor/usePropsHandler";export var checkboxPropSize=["m","xs","s","l"];export var checkboxPropSizeDefault=checkboxPropSize[0];export var checkboxPropView=["primary","ghost"];export var checkboxPropViewDefault=checkboxPropView[0];export var checkboxPropAlign=["center","top"];export var checkboxPropAlignDefault=checkboxPropAlign[0];export var COMPONENT_NAME="Checkbox";export var cnCheckbox=cn("Checkbox");export var Checkbox=React.forwardRef(function(a,b){var c=React.useRef(null),d=usePropsHandler(COMPONENT_NAME,a,c),e=d.checked,f=d.name,g=d.size,h=void 0===g?checkboxPropSizeDefault:g,i=d.view,j=void 0===i?checkboxPropViewDefault:i,k=d.align,l=void 0===k?checkboxPropAlignDefault:k,m=d.disabled,n=d.intermediate,o=d.className,p=d.label,q=d.onChange,r=d.onFocus,s=d.onBlur,t=d.readOnly,u=d.required,v=d.step,w=d.tabIndex,x=d.inputId,y=d.inputRef,z=_objectWithoutProperties(d,_excluded);return React.createElement("label",Object.assign({},z,{className:cnCheckbox({size:h,view:j,disabled:m,intermediate:void 0!==n&&n,align:l},[o]),ref:useForkRef([b,c])}),React.createElement("input",{type:"checkbox",name:f,className:cnCheckbox("Input",[cnMixFocus()]),checked:void 0!==e&&e,id:x,disabled:m,onChange:q,onFocus:r,onBlur:s,readOnly:t,required:u,step:v,tabIndex:w,ref:y}),p&&React.createElement("span",{className:cnCheckbox("Label")},p))});
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","name","size","view","align","disabled","intermediate","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputId","inputRef"];import"./Checkbox.css";import React from"react";import{useForkRef}from"../../hooks/useForkRef/useForkRef";import{cnMixFocus}from"../../mixs/MixFocus/MixFocus";import{cn}from"../../utils/bem";import{usePropsHandler}from"../EventInterceptor/usePropsHandler";export var checkboxPropSize=["m","xs","s","l"];export var checkboxPropSizeDefault=checkboxPropSize[0];export var checkboxPropView=["primary","ghost"];export var checkboxPropViewDefault=checkboxPropView[0];export var checkboxPropAlign=["center","top"];export var checkboxPropAlignDefault=checkboxPropAlign[0];var checkboxPropOnChangeDefault=function(){};export var COMPONENT_NAME="Checkbox";export var cnCheckbox=cn("Checkbox");export var Checkbox=React.forwardRef(function(a,b){var c=React.useRef(null),d=usePropsHandler(COMPONENT_NAME,a,c),e=d.checked,f=d.name,g=d.size,h=void 0===g?checkboxPropSizeDefault:g,i=d.view,j=void 0===i?checkboxPropViewDefault:i,k=d.align,l=void 0===k?checkboxPropAlignDefault:k,m=d.disabled,n=d.intermediate,o=d.className,p=d.label,q=d.onChange,r=void 0===q?checkboxPropOnChangeDefault:q,s=d.onFocus,t=d.onBlur,u=d.readOnly,v=d.required,w=d.step,x=d.tabIndex,y=d.inputId,z=d.inputRef,A=_objectWithoutProperties(d,_excluded);return React.createElement("label",Object.assign({},A,{className:cnCheckbox({size:h,view:j,disabled:m,intermediate:void 0!==n&&n,align:l},[o]),ref:useForkRef([b,c])}),React.createElement("input",{type:"checkbox",name:f,className:cnCheckbox("Input",[cnMixFocus()]),checked:void 0!==e&&e,id:y,disabled:m,onChange:r,onFocus:s,onBlur:t,readOnly:u,required:v,step:w,tabIndex:x,ref:z}),p&&React.createElement("span",{className:cnCheckbox("Label")},p))});
2
2
  //# sourceMappingURL=Checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","names":["React","useForkRef","cnMixFocus","cn","usePropsHandler","checkboxPropSize","checkboxPropSizeDefault","checkboxPropView","checkboxPropViewDefault","checkboxPropAlign","checkboxPropAlignDefault","COMPONENT_NAME","cnCheckbox","Checkbox","forwardRef","props","ref","checkboxRef","useRef","checked","name","size","view","align","disabled","intermediate","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputId","inputRef","otherProps"],"sources":["../../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import './Checkbox.css';\n\nimport React, { ChangeEventHandler } from 'react';\n\nimport { useForkRef } from '../../hooks/useForkRef/useForkRef';\nimport { cnMixFocus } from '../../mixs/MixFocus/MixFocus';\nimport { cn } from '../../utils/bem';\nimport { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';\nimport { usePropsHandler } from '../EventInterceptor/usePropsHandler';\n\nexport const checkboxPropSize = ['m', 'xs', 's', 'l'] as const;\nexport type CheckboxPropSize = typeof checkboxPropSize[number];\nexport const checkboxPropSizeDefault: CheckboxPropSize = checkboxPropSize[0];\n\nexport const checkboxPropView = ['primary', 'ghost'] as const;\nexport type CheckboxPropView = typeof checkboxPropView[number];\nexport const checkboxPropViewDefault: CheckboxPropView = checkboxPropView[0];\n\nexport const checkboxPropAlign = ['center', 'top'] as const;\nexport type CheckboxPropAlign = typeof checkboxPropAlign[number];\nexport const checkboxPropAlignDefault: CheckboxPropAlign = checkboxPropAlign[0];\n\nexport type CheckboxPropOnChange = (\n checked: boolean,\n params: {\n e: React.ChangeEvent<HTMLInputElement>;\n },\n) => void;\n\ntype Props = {\n checked: boolean | undefined;\n size?: CheckboxPropSize;\n view?: CheckboxPropView;\n align?: CheckboxPropAlign;\n disabled?: boolean;\n intermediate?: boolean;\n label?: string;\n onChange?: ChangeEventHandler<HTMLInputElement>;\n name?: string;\n onFocus?: React.FocusEventHandler<HTMLInputElement>;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n autoFocus?: boolean;\n readOnly?: boolean;\n required?: boolean;\n step?: number | string;\n tabIndex?: number;\n inputRef?: React.Ref<HTMLInputElement>;\n children?: never;\n for?: string;\n inputId?: string;\n};\n\nexport type CheckboxProps = PropsWithHTMLAttributes<Props, HTMLLabelElement>;\n\nexport const COMPONENT_NAME = 'Checkbox' as const;\nexport const cnCheckbox = cn(COMPONENT_NAME);\n\nexport const Checkbox = React.forwardRef<HTMLLabelElement, CheckboxProps>(\n (props, ref) => {\n const checkboxRef = React.useRef<HTMLLabelElement>(null);\n\n const {\n checked = false,\n name,\n size = checkboxPropSizeDefault,\n view = checkboxPropViewDefault,\n align = checkboxPropAlignDefault,\n disabled,\n intermediate = false,\n className,\n label,\n onChange,\n onFocus,\n onBlur,\n readOnly,\n required,\n step,\n tabIndex,\n inputId,\n inputRef,\n ...otherProps\n } = usePropsHandler(COMPONENT_NAME, props, checkboxRef);\n\n return (\n <label\n {...otherProps}\n className={cnCheckbox({ size, view, disabled, intermediate, align }, [\n className,\n ])}\n ref={useForkRef([ref, checkboxRef])}\n >\n <input\n type=\"checkbox\"\n name={name}\n className={cnCheckbox('Input', [cnMixFocus()])}\n checked={checked}\n id={inputId}\n disabled={disabled}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n readOnly={readOnly}\n required={required}\n step={step}\n tabIndex={tabIndex}\n ref={inputRef}\n />\n {label && <span className={cnCheckb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Y,GAiBZA,QAjBY,CAkBZC,CAlBY,GAkBZA,IAlBY,CAmBZC,CAnBY,GAmBZA,QAnBY,CAoBZC,CApBY,GAoBZA,OApBY,CAqBZC,CArBY,GAqBZA,QArBY,CAsBTC,CAtBS,uCAyBd,MACE,8CACMA,CADN,EAEE,SAAS,CAAEzB,UAAU,CAAC,CAAES,IAAI,CAAJA,CAAF,CAAQC,IAAI,CAAJA,CAAR,CAAcE,QAAQ,CAARA,CAAd,CAAwBC,YAAY,cAApC,CAAsCF,KAAK,CAALA,CAAtC,CAAD,CAAgD,CACnEG,CADmE,CAAhD,CAFvB,CAKE,GAAG,CAAEzB,UAAU,CAAC,CAACe,CAAD,CAAMC,CAAN,CAAD,CALjB,GAOE,6BACE,IAAI,CAAC,UADP,CAEE,IAAI,CAAEG,CAFR,CAGE,SAAS,CAAER,UAAU,CAAC,OAAD,CAAU,CAACV,UAAU,EAAX,CAAV,CAHvB,CAIE,OAAO,cAJT,CAKE,EAAE,CAAEiC,CALN,CAME,QAAQ,CAAEX,CANZ,CAOE,QAAQ,CAAEI,CAPZ,CAQE,OAAO,CAAEC,CARX,CASE,MAAM,CAAEC,CATV,CAUE,QAAQ,CAAEC,CAVZ,CAWE,QAAQ,CAAEC,CAXZ,CAYE,IAAI,CAAEC,CAZR,CAaE,QAAQ,CAAEC,CAbZ,CAcE,GAAG,CAAEE,CAdP,EAPF,CAuBGT,CAAK,EAAI,4BAAM,SAAS,CAAEf,UAAU,CAAC,OAAD,CAA3B,EAAuCe,CAAvC,CAvBZ,CA0BH,CArDqB,CAAjB"}
1
+ {"version":3,"file":"Checkbox.js","names":["React","useForkRef","cnMixFocus","cn","usePropsHandler","checkboxPropSize","checkboxPropSizeDefault","checkboxPropView","checkboxPropViewDefault","checkboxPropAlign","checkboxPropAlignDefault","checkboxPropOnChangeDefault","COMPONENT_NAME","cnCheckbox","Checkbox","forwardRef","props","ref","checkboxRef","useRef","checked","name","size","view","align","disabled","intermediate","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputId","inputRef","otherProps"],"sources":["../../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import './Checkbox.css';\n\nimport React, { ChangeEventHandler } from 'react';\n\nimport { useForkRef } from '../../hooks/useForkRef/useForkRef';\nimport { cnMixFocus } from '../../mixs/MixFocus/MixFocus';\nimport { cn } from '../../utils/bem';\nimport { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';\nimport { usePropsHandler } from '../EventInterceptor/usePropsHandler';\n\nexport const checkboxPropSize = ['m', 'xs', 's', 'l'] as const;\nexport type CheckboxPropSize = typeof checkboxPropSize[number];\nexport const checkboxPropSizeDefault: CheckboxPropSize = checkboxPropSize[0];\n\nexport const checkboxPropView = ['primary', 'ghost'] as const;\nexport type CheckboxPropView = typeof checkboxPropView[number];\nexport const checkboxPropViewDefault: CheckboxPropView = checkboxPropView[0];\n\nexport const checkboxPropAlign = ['center', 'top'] as const;\nexport type CheckboxPropAlign = typeof checkboxPropAlign[number];\nexport const checkboxPropAlignDefault: CheckboxPropAlign = checkboxPropAlign[0];\n\nexport type CheckboxPropOnChange = (\n checked: boolean,\n params: {\n e: React.ChangeEvent<HTMLInputElement>;\n },\n) => void;\n\nconst checkboxPropOnChangeDefault = () => {};\n\ntype Props = {\n checked: boolean | undefined;\n size?: CheckboxPropSize;\n view?: CheckboxPropView;\n align?: CheckboxPropAlign;\n disabled?: boolean;\n intermediate?: boolean;\n label?: string;\n onChange?: ChangeEventHandler<HTMLInputElement>;\n name?: string;\n onFocus?: React.FocusEventHandler<HTMLInputElement>;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n autoFocus?: boolean;\n readOnly?: boolean;\n required?: boolean;\n step?: number | string;\n tabIndex?: number;\n inputRef?: React.Ref<HTMLInputElement>;\n children?: never;\n for?: string;\n inputId?: string;\n};\n\nexport type CheckboxProps = PropsWithHTMLAttributes<Props, HTMLLabelElement>;\n\nexport const COMPONENT_NAME = 'Checkbox' as const;\nexport const cnCheckbox = cn(COMPONENT_NAME);\n\nexport const Checkbox = React.forwardRef<HTMLLabelElement, CheckboxProps>(\n (props, ref) => {\n const checkboxRef = React.useRef<HTMLLabelElement>(null);\n\n const {\n checked = false,\n name,\n size = checkboxPropSizeDefault,\n view = checkboxPropViewDefault,\n align = checkboxPropAlignDefault,\n disabled,\n intermediate = false,\n className,\n label,\n onChange = checkboxPropOnChangeDefault,\n onFocus,\n onBlur,\n readOnly,\n required,\n step,\n tabIndex,\n inputId,\n inputRef,\n ...otherProps\n } = usePropsHandler(COMPONENT_NAME, props, checkboxRef);\n\n return (\n <label\n {...otherProps}\n className={cnCheckbox({ size, view, disabled, intermediate, align }, [\n className,\n ])}\n ref={useForkRef([ref, checkboxRef])}\n >\n <input\n type=\"checkbox\"\n name={name}\n className={cnCheckbox('Input', [cnMixFocus()])}\n checked={checked}\n id={inputId}\n disabled={disabled}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n readOnly={readOnly}\n required={required}\n step={step}\n tabIndex={tabIndex}\n ref={inputRef}\n />\n {label && <span className={cnCheckbox('Label')}>{label}</span>}\n </label>\n );\n },\n);\n"],"mappings":"qRAAA,uBAEA,MAAOA,MAAP,KAA0C,OAA1C,CAEA,OAASC,UAAT,yCACA,OAASC,UAAT,oCACA,OAASC,EAAT,uBAEA,OAASC,eAAT,2CAEA,MAAO,IAAMC,iBAAgB,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAAzB,CAEP,MAAO,IAAMC,wBAAyC,CAAGD,gBAAgB,CAAC,CAAD,CAAlE,CAEP,MAAO,IAAME,iBAAgB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAzB,CAEP,MAAO,IAAMC,wBAAyC,CAAGD,gBAAgB,CAAC,CAAD,CAAlE,CAEP,MAAO,IAAME,kBAAiB,CAAG,CAAC,QAAD,CAAW,KAAX,CAA1B,CAEP,MAAO,IAAMC,yBAA2C,CAAGD,iBAAiB,CAAC,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AAEG,CAFR,CAGE,SAAS,CAAER,UAAU,CAAC,OAAD,CAAU,CAACX,UAAU,EAAX,CAAV,CAHvB,CAIE,OAAO,cAJT,CAKE,EAAE,CAAEkC,CALN,CAME,QAAQ,CAAEX,CANZ,CAOE,QAAQ,CAAEI,CAPZ,CAQE,OAAO,CAAEC,CARX,CASE,MAAM,CAAEC,CATV,CAUE,QAAQ,CAAEC,CAVZ,CAWE,QAAQ,CAAEC,CAXZ,CAYE,IAAI,CAAEC,CAZR,CAaE,QAAQ,CAAEC,CAbZ,CAcE,GAAG,CAAEE,CAdP,EAPF,CAuBGT,CAAK,EAAI,4BAAM,SAAS,CAAEf,UAAU,CAAC,OAAD,CAA3B,EAAuCe,CAAvC,CAvBZ,CA0BH,CArDqB,CAAjB"}
@@ -1,2 +1,2 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","name","size","view","align","disabled","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputId","inputRef"];import"./Radio.css";import React,{useRef}from"react";import{useForkRef}from"../../hooks/useForkRef/useForkRef";import{cnMixFocus}from"../../mixs/MixFocus/MixFocus";import{cn}from"../../utils/bem";import{usePropsHandler}from"../EventInterceptor/usePropsHandler";export var radioPropSize=["m","l","s","xs"];export var radioPropSizeDefault=radioPropSize[0];export var radioPropView=["primary","ghost"];export var radioPropViewDefault=radioPropView[0];export var radioPropAlign=["center","top"];export var radioPropAlignDefault=radioPropAlign[0];export var cnRadio=cn("Radio");export var COMPONENT_NAME="Radio";export var Radio=React.forwardRef(function(a,b){var c=useRef(null),d=usePropsHandler(COMPONENT_NAME,a,c),e=d.checked,f=d.name,g=d.size,h=void 0===g?radioPropSizeDefault:g,i=d.view,j=void 0===i?radioPropViewDefault:i,k=d.align,l=void 0===k?radioPropAlignDefault:k,m=d.disabled,n=d.className,o=d.label,p=d.onChange,q=d.onFocus,r=d.onBlur,s=d.readOnly,t=d.required,u=d.step,v=d.tabIndex,w=d.inputId,x=d.inputRef,y=_objectWithoutProperties(d,_excluded);return React.createElement("label",Object.assign({},y,{className:cnRadio({size:h,view:j,disabled:m,align:l},[n]),ref:useForkRef([b,c])}),React.createElement("input",{type:"radio",name:f,className:cnRadio("Input",[cnMixFocus()]),checked:void 0!==e&&e,disabled:m,onChange:p,onFocus:q,onBlur:r,readOnly:s,required:t,step:u,id:w,tabIndex:v,ref:x}),o&&React.createElement("span",{className:cnRadio("Label")},o))});
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","name","size","view","align","disabled","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputId","inputRef"];import"./Radio.css";import React,{useRef}from"react";import{useForkRef}from"../../hooks/useForkRef/useForkRef";import{cnMixFocus}from"../../mixs/MixFocus/MixFocus";import{cn}from"../../utils/bem";import{usePropsHandler}from"../EventInterceptor/usePropsHandler";export var radioPropSize=["m","l","s","xs"];export var radioPropSizeDefault=radioPropSize[0];export var radioPropView=["primary","ghost"];export var radioPropViewDefault=radioPropView[0];export var radioPropAlign=["center","top"];export var radioPropAlignDefault=radioPropAlign[0];var radioPropOnChangeDefault=function(){};export var cnRadio=cn("Radio");export var COMPONENT_NAME="Radio";export var Radio=React.forwardRef(function(a,b){var c=useRef(null),d=usePropsHandler(COMPONENT_NAME,a,c),e=d.checked,f=d.name,g=d.size,h=void 0===g?radioPropSizeDefault:g,i=d.view,j=void 0===i?radioPropViewDefault:i,k=d.align,l=void 0===k?radioPropAlignDefault:k,m=d.disabled,n=d.className,o=d.label,p=d.onChange,q=void 0===p?radioPropOnChangeDefault:p,r=d.onFocus,s=d.onBlur,t=d.readOnly,u=d.required,v=d.step,w=d.tabIndex,x=d.inputId,y=d.inputRef,z=_objectWithoutProperties(d,_excluded);return React.createElement("label",Object.assign({},z,{className:cnRadio({size:h,view:j,disabled:m,align:l},[n]),ref:useForkRef([b,c])}),React.createElement("input",{type:"radio",name:f,className:cnRadio("Input",[cnMixFocus()]),checked:void 0!==e&&e,disabled:m,onChange:q,onFocus:r,onBlur:s,readOnly:t,required:u,step:v,id:x,tabIndex:w,ref:y}),o&&React.createElement("span",{className:cnRadio("Label")},o))});
2
2
  //# sourceMappingURL=Radio.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","names":["React","useRef","useForkRef","cnMixFocus","cn","usePropsHandler","radioPropSize","radioPropSizeDefault","radioPropView","radioPropViewDefault","radioPropAlign","radioPropAlignDefault","cnRadio","COMPONENT_NAME","Radio","forwardRef","props","ref","radioRef","checked","name","size","view","align","disabled","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputId","inputRef","otherProps"],"sources":["../../../../../src/components/Radio/Radio.tsx"],"sourcesContent":["import './Radio.css';\n\nimport React, { ChangeEventHandler, useRef } from 'react';\n\nimport { useForkRef } from '../../hooks/useForkRef/useForkRef';\nimport { cnMixFocus } from '../../mixs/MixFocus/MixFocus';\nimport { cn } from '../../utils/bem';\nimport { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';\nimport { usePropsHandler } from '../EventInterceptor/usePropsHandler';\n\nexport const radioPropSize = ['m', 'l', 's', 'xs'] as const;\nexport type RadioPropSize = typeof radioPropSize[number];\nexport const radioPropSizeDefault: RadioPropSize = radioPropSize[0];\n\nexport const radioPropView = ['primary', 'ghost'] as const;\nexport type RadioPropView = typeof radioPropView[number];\nexport const radioPropViewDefault: RadioPropView = radioPropView[0];\n\nexport const radioPropAlign = ['center', 'top'] as const;\nexport type RadioPropAlign = typeof radioPropAlign[number];\nexport const radioPropAlignDefault: RadioPropAlign = radioPropAlign[0];\n\nexport type RadioPropOnChange = (\n checked: boolean,\n params: {\n e: React.ChangeEvent<HTMLInputElement>;\n },\n) => void;\n\nexport type Props = {\n checked?: boolean;\n size?: RadioPropSize;\n view?: RadioPropView;\n align?: RadioPropAlign;\n disabled?: boolean;\n className?: string;\n label?: string;\n onChange?: ChangeEventHandler<HTMLInputElement>;\n name?: string;\n onFocus?: React.FocusEventHandler<HTMLInputElement>;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n autoFocus?: boolean;\n readOnly?: boolean;\n required?: boolean;\n step?: number | string;\n tabIndex?: number;\n inputRef?: React.Ref<HTMLInputElement>;\n children?: never;\n for?: string;\n inputId?: string;\n};\n\nexport type RadioProps = PropsWithHTMLAttributes<Props, HTMLLabelElement>;\n\nexport const cnRadio = cn('Radio');\n\nexport const COMPONENT_NAME = 'Radio' as const;\n\nexport const Radio = React.forwardRef<HTMLLabelElement, RadioProps>(\n (props, ref) => {\n const radioRef = useRef<HTMLLabelElement>(null);\n\n const {\n checked = false,\n name,\n size = radioPropSizeDefault,\n view = radioPropViewDefault,\n align = radioPropAlignDefault,\n disabled,\n className,\n label,\n onChange,\n onFocus,\n onBlur,\n readOnly,\n required,\n step,\n tabIndex,\n inputId,\n inputRef,\n ...otherProps\n } = usePropsHandler(COMPONENT_NAME, props, radioRef);\n\n return (\n <label\n {...otherProps}\n className={cnRadio({ size, view, disabled, align }, [className])}\n ref={useForkRef([ref, radioRef])}\n >\n <input\n type=\"radio\"\n name={name}\n className={cnRadio('Input', [cnMixFocus()])}\n checked={checked}\n disabled={disabled}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n readOnly={readOnly}\n required={required}\n step={step}\n id={inputId}\n tabIndex={tabIndex}\n ref={inputRef}\n />\n {label && <span className={cnRadio('Label')}>{label}</span>}\n </label>\n );\n },\n);\n"],"mappings":"sQAAA,oBAEA,MAAOA,MAAP,EAAoCC,MAApC,KAAkD,OAAlD,CAEA,OAASC,UAAT,yCACA,OAASC,UAAT,oCACA,OAASC,EAAT,uBAEA,OAASC,eAAT,2CAEA,MAAO,IAAMC,cAAa,CAAG,CAAC,GAAD,CAAM,GAAN,CAAW,GAAX,CAAgB,IAAhB,CAAtB,CAEP,MAAO,IAAMC,qBAAmC,CAAGD,aAAa,CAAC,CAAD,CAAzD,CAEP,MAAO,IAAME,cAAa,CAAG,CAAC,SAAD,CAA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C,CAACe,CAAD,CAAMC,CAAN,CAAD,CAHjB,GAKE,6BACE,IAAI,CAAC,OADP,CAEE,IAAI,CAAEE,CAFR,CAGE,SAAS,CAAER,OAAO,CAAC,OAAD,CAAU,CAACT,UAAU,EAAX,CAAV,CAHpB,CAIE,OAAO,cAJT,CAKE,QAAQ,CAAEqB,CALZ,CAME,QAAQ,CAAEG,CANZ,CAOE,OAAO,CAAEC,CAPX,CAQE,MAAM,CAAEC,CARV,CASE,QAAQ,CAAEC,CATZ,CAUE,QAAQ,CAAEC,CAVZ,CAWE,IAAI,CAAEC,CAXR,CAYE,EAAE,CAAEE,CAZN,CAaE,QAAQ,CAAED,CAbZ,CAcE,GAAG,CAAEE,CAdP,EALF,CAqBGT,CAAK,EAAI,4BAAM,SAAS,CAAEd,OAAO,CAAC,OAAD,CAAxB,EAAoCc,CAApC,CArBZ,CAwBH,CAlDkB,CAAd"}
1
+ {"version":3,"file":"Radio.js","names":["React","useRef","useForkRef","cnMixFocus","cn","usePropsHandler","radioPropSize","radioPropSizeDefault","radioPropView","radioPropViewDefault","radioPropAlign","radioPropAlignDefault","radioPropOnChangeDefault","cnRadio","COMPONENT_NAME","Radio","forwardRef","props","ref","radioRef","checked","name","size","view","align","disabled","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputId","inputRef","otherProps"],"sources":["../../../../../src/components/Radio/Radio.tsx"],"sourcesContent":["import './Radio.css';\n\nimport React, { ChangeEventHandler, useRef } from 'react';\n\nimport { useForkRef } from '../../hooks/useForkRef/useForkRef';\nimport { cnMixFocus } from '../../mixs/MixFocus/MixFocus';\nimport { cn } from '../../utils/bem';\nimport { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';\nimport { usePropsHandler } from '../EventInterceptor/usePropsHandler';\n\nexport const radioPropSize = ['m', 'l', 's', 'xs'] as const;\nexport type RadioPropSize = typeof radioPropSize[number];\nexport const radioPropSizeDefault: RadioPropSize = radioPropSize[0];\n\nexport const radioPropView = ['primary', 'ghost'] as const;\nexport type RadioPropView = typeof radioPropView[number];\nexport const radioPropViewDefault: RadioPropView = radioPropView[0];\n\nexport const radioPropAlign = ['center', 'top'] as const;\nexport type RadioPropAlign = typeof radioPropAlign[number];\nexport const radioPropAlignDefault: RadioPropAlign = radioPropAlign[0];\n\nconst radioPropOnChangeDefault = () => {};\n\nexport type RadioPropOnChange = (\n checked: boolean,\n params: {\n e: React.ChangeEvent<HTMLInputElement>;\n },\n) => void;\n\nexport type Props = {\n checked?: boolean;\n size?: RadioPropSize;\n view?: RadioPropView;\n align?: RadioPropAlign;\n disabled?: boolean;\n className?: string;\n label?: string;\n onChange?: ChangeEventHandler<HTMLInputElement>;\n name?: string;\n onFocus?: React.FocusEventHandler<HTMLInputElement>;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n autoFocus?: boolean;\n readOnly?: boolean;\n required?: boolean;\n step?: number | string;\n tabIndex?: number;\n inputRef?: React.Ref<HTMLInputElement>;\n children?: never;\n for?: string;\n inputId?: string;\n};\n\nexport type RadioProps = PropsWithHTMLAttributes<Props, HTMLLabelElement>;\n\nexport const cnRadio = cn('Radio');\n\nexport const COMPONENT_NAME = 'Radio' as const;\n\nexport const Radio = React.forwardRef<HTMLLabelElement, RadioProps>(\n (props, ref) => {\n const radioRef = useRef<HTMLLabelElement>(null);\n\n const {\n checked = false,\n name,\n size = radioPropSizeDefault,\n view = radioPropViewDefault,\n align = radioPropAlignDefault,\n disabled,\n className,\n label,\n onChange = radioPropOnChangeDefault,\n onFocus,\n onBlur,\n readOnly,\n required,\n step,\n tabIndex,\n inputId,\n inputRef,\n ...otherProps\n } = usePropsHandler(COMPONENT_NAME, props, radioRef);\n\n return (\n <label\n {...otherProps}\n className={cnRadio({ size, view, disabled, align }, [className])}\n ref={useForkRef([ref, radioRef])}\n >\n <input\n type=\"radio\"\n name={name}\n className={cnRadio('Input', [cnMixFocus()])}\n checked={checked}\n disabled={disabled}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n readOnly={readOnly}\n required={required}\n step={step}\n id={inputId}\n tabIndex={tabIndex}\n ref={inputRef}\n />\n {label && <span className={cnRadio('Label')}>{label}</span>}\n </label>\n );\n },\n);\n"],"mappings":"sQAAA,oBAEA,MAAOA,MAAP,EAAoCC,MAApC,KAAkD,OAAlD,CAEA,OAASC,UAAT,yCACA,OAASC,UAAT,oCACA,OAASC,EAAT,uBAEA,OAASC,eAAT,2CAEA,MAAO,IAAMC,cAAa,CAAG,CAAC,GAAD,CAAM,GAAN,CAAW,GAAX,CAAgB,IAAhB,CAAtB,CAEP,MAAO,IAAMC,qBAAmC,CAAGD,aAAa,CAAC,CAAD,CAAzD,CAEP,MAAO,IAAME,cAAa,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAtB,CAEP,MAAO,IAAMC,qBAAmC,CAAGD,aAAa,CAAC,CAAD,CAAzD,CAEP,MAAO,IAAME,eAAc,CAAG,CAAC,QAAD,CAAW,KAAX,CAAvB,CAEP,MAAO,IAAMC,sBAAqC,CAAGD,cAAc,CAAC,CAAD,CAA5D,CAEP,GAAME,yBAAwB,CAAG,UAAM,CAAE,CAAzC,CAkCA,MAAO,IAAMC,QAAO,CAAGT,EAAE,CAAC,OAAD,CAAlB,CAEP,MAAO,IAAMU,eAAc,CAAG,OAAvB,CAEP,MAAO,IAAMC,MAAK,CAAGf,KAAK,CAACgB,UAAN,CACnB,SAACC,CAAD,CAAQC,CAAR,CAAgB,IACRC,EAAQ,CAAGlB,MAAM,CAAmB,IAAnB,CADT,GAsBVI,eAAe,CAACS,cAAD,CAAiBG,CAAjB,CAAwBE,CAAxB,CAtBL,KAIZC,OAJY,CAKZC,CALY,GAKZA,IALY,KAMZC,IANY,CAMZA,CANY,YAMLf,oBANK,OAOZgB,IAPY,CAOZA,CAPY,YAOLd,oBAPK,OAQZe,KARY,CAQZA,CARY,YAQJb,qBARI,GASZc,CATY,GASZA,QATY,CAUZC,CAVY,GAUZA,SAVY,CAWZC,CAXY,GAWZA,KAXY,KAYZC,QAZY,CAYZA,CAZY,YAYDhB,wBAZC,GAaZiB,CAbY,GAaZA,OAbY,CAcZC,CAdY,GAcZA,MAdY,CAeZC,CAfY,GAeZA,QAfY,CAgBZC,CAhBY,GAgBZA,QAhBY,CAiBZC,CAjBY,GAiBZA,IAjBY,CAkBZC,CAlBY,GAkBZA,QAlBY,CAmBZC,CAnBY,GAmBZA,OAnBY,CAoBZC,CApBY,GAoBZA,QApBY,CAqBTC,CArBS,uCAwBd,MACE,8CACMA,CADN,EAEE,SAAS,CAAExB,OAAO,CAAC,CAAES,IAAI,CAAJA,CAAF,CAAQC,IAAI,CAAJA,CAAR,CAAcE,QAAQ,CAARA,CAAd,CAAwBD,KAAK,CAALA,CAAxB,CAAD,CAAkC,CAACE,CAAD,CAAlC,CAFpB,CAGE,GAAG,CAAExB,UAAU,CAAC,CAACgB,CAAD,CAAMC,CAAN,CAAD,CAHjB,GAKE,6BACE,IAAI,CAAC,OADP,CAEE,IAAI,CAAEE,CAFR,CAGE,SAAS,CAAER,OAAO,CAAC,OAAD,CAAU,CAACV,UAAU,EAAX,CAAV,CAHpB,CAIE,OAAO,cAJT,CAKE,QAAQ,CAAEsB,CALZ,CAME,QAAQ,CAAEG,CANZ,CAOE,OAAO,CAAEC,CAPX,CAQE,MAAM,CAAEC,CARV,CASE,QAAQ,CAAEC,CATZ,CAUE,QAAQ,CAAEC,CAVZ,CAWE,IAAI,CAAEC,CAXR,CAYE,EAAE,CAAEE,CAZN,CAaE,QAAQ,CAAED,CAbZ,CAcE,GAAG,CAAEE,CAdP,EALF,CAqBGT,CAAK,EAAI,4BAAM,SAAS,CAAEd,OAAO,CAAC,OAAD,CAAxB,EAAoCc,CAApC,CArBZ,CAwBH,CAlDkB,CAAd"}
@@ -1,2 +1,2 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","labelForCreate","inputValue","active","hovered","size","indent"];import"./SelectCreateButton.css";import React,{forwardRef}from"react";import{ListAddItem}from"../../ListCanary";import{cnCanary}from"../../../utils/bem";export var cnSelectCreateButton=cnCanary("SelectCreateButton");export var SelectCreateButton=forwardRef(function(a,b){var c=a.className,d=a.labelForCreate,e=a.inputValue,f=a.active,g=a.hovered,h=a.size,i=a.indent,j=_objectWithoutProperties(a,_excluded);return React.createElement(ListAddItem,Object.assign({},j,{ref:b,className:cnSelectCreateButton(null,[c]),"aria-selected":f,role:"option",active:g,size:h,innerOffset:i,label:React.createElement(React.Fragment,null,d," \xAB",React.createElement("b",null,e),"\xBB")}))});
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","labelForCreate","inputValue","active","hovered","size","indent"];import"./SelectCreateButton.css";import React,{forwardRef}from"react";import{ListAddItem}from"../../ListCanary";import{cn}from"../../../utils/bem";export var cnSelectCreateButton=cn("SelectCreateButton");export var SelectCreateButton=forwardRef(function(a,b){var c=a.className,d=a.labelForCreate,e=a.inputValue,f=a.active,g=a.hovered,h=a.size,i=a.indent,j=_objectWithoutProperties(a,_excluded);return React.createElement(ListAddItem,Object.assign({},j,{ref:b,className:cnSelectCreateButton(null,[c]),"aria-selected":f,role:"option",active:g,size:h,innerOffset:i,label:React.createElement(React.Fragment,null,d," \xAB",React.createElement("b",null,e),"\xBB")}))});
2
2
  //# sourceMappingURL=SelectCreateButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectCreateButton.js","names":["React","forwardRef","ListAddItem","cnCanary","cnSelectCreateButton","SelectCreateButton","props","ref","className","labelForCreate","inputValue","active","hovered","size","indent","otherProps"],"sources":["../../../../../../src/components/SelectComponents/SelectCreateButton/SelectCreateButton.tsx"],"sourcesContent":["import './SelectCreateButton.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { ListAddItem } from '##/components/ListCanary';\nimport { cnCanary } from '##/utils/bem';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nimport { PropSize } from '../types';\n\ntype SelectCreateButtonProps = PropsWithHTMLAttributesAndRef<\n {\n labelForCreate?: string;\n inputValue?: string;\n active: boolean;\n hovered: boolean;\n size: PropSize;\n indent: 'normal' | 'increased';\n },\n HTMLDivElement\n>;\n\nexport const cnSelectCreateButton = cnCanary('SelectCreateButton');\n\nexport const SelectCreateButton: React.FC<SelectCreateButtonProps> = forwardRef(\n (props, ref) => {\n const {\n className,\n labelForCreate,\n inputValue,\n active,\n hovered,\n size,\n indent,\n ...otherProps\n } = props;\n\n return (\n <ListAddItem\n {...otherProps}\n ref={ref}\n className={cnSelectCreateButton(null, [className])}\n aria-selected={active}\n role=\"option\"\n active={hovered}\n size={size}\n innerOffset={indent}\n label={\n <>\n {labelForCreate} «<b>{inputValue}</b>»\n </>\n }\n />\n );\n },\n);\n"],"mappings":"kLAAA,iCAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,WAAT,wBACA,OAASC,QAAT,0BAiBA,MAAO,IAAMC,qBAAoB,CAAGD,QAAQ,CAAC,oBAAD,CAArC,CAEP,MAAO,IAAME,mBAAqD,CAAGJ,UAAU,CAC7E,SAACK,CAAD,CAAQC,CAAR,CAAgB,CACd,GACEC,EADF,CASIF,CATJ,CACEE,SADF,CAEEC,CAFF,CASIH,CATJ,CAEEG,cAFF,CAGEC,CAHF,CASIJ,CATJ,CAGEI,UAHF,CAIEC,CAJF,CASIL,CATJ,CAIEK,MAJF,CAKEC,CALF,CASIN,CATJ,CAKEM,OALF,CAMEC,CANF,CASIP,CATJ,CAMEO,IANF,CAOEC,CAPF,CASIR,CATJ,CAOEQ,MAPF,CAQKC,CARL,0BASIT,CATJ,YAWA,MACE,qBAAC,WAAD,kBACMS,CADN,EAEE,GAAG,CAAER,CAFP,CAGE,SAAS,CAAEH,oBAAoB,CAAC,IAAD,CAAO,CAACI,CAAD,CAAP,CAHjC,CAIE,gBAAeG,CAJjB,CAKE,IAAI,CAAC,QALP,CAME,MAAM,CAAEC,CANV,CAOE,IAAI,CAAEC,CAPR,CAQE,WAAW,CAAEC,CARf,CASE,KAAK,CACH,wCACGL,CADH,SACoB,6BAAIC,CAAJ,CADpB,QAVJ,GAgBH,CA9B4E,CAAxE"}
1
+ {"version":3,"file":"SelectCreateButton.js","names":["React","forwardRef","ListAddItem","cn","cnSelectCreateButton","SelectCreateButton","props","ref","className","labelForCreate","inputValue","active","hovered","size","indent","otherProps"],"sources":["../../../../../../src/components/SelectComponents/SelectCreateButton/SelectCreateButton.tsx"],"sourcesContent":["import './SelectCreateButton.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { ListAddItem } from '##/components/ListCanary';\nimport { cn } from '##/utils/bem';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nimport { PropSize } from '../types';\n\ntype SelectCreateButtonProps = PropsWithHTMLAttributesAndRef<\n {\n labelForCreate?: string;\n inputValue?: string;\n active: boolean;\n hovered: boolean;\n size: PropSize;\n indent: 'normal' | 'increased';\n },\n HTMLDivElement\n>;\n\nexport const cnSelectCreateButton = cn('SelectCreateButton');\n\nexport const SelectCreateButton: React.FC<SelectCreateButtonProps> = forwardRef(\n (props, ref) => {\n const {\n className,\n labelForCreate,\n inputValue,\n active,\n hovered,\n size,\n indent,\n ...otherProps\n } = props;\n\n return (\n <ListAddItem\n {...otherProps}\n ref={ref}\n className={cnSelectCreateButton(null, [className])}\n aria-selected={active}\n role=\"option\"\n active={hovered}\n size={size}\n innerOffset={indent}\n label={\n <>\n {labelForCreate} «<b>{inputValue}</b>»\n </>\n }\n />\n );\n },\n);\n"],"mappings":"kLAAA,iCAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,WAAT,wBACA,OAASC,EAAT,0BAiBA,MAAO,IAAMC,qBAAoB,CAAGD,EAAE,CAAC,oBAAD,CAA/B,CAEP,MAAO,IAAME,mBAAqD,CAAGJ,UAAU,CAC7E,SAACK,CAAD,CAAQC,CAAR,CAAgB,CACd,GACEC,EADF,CASIF,CATJ,CACEE,SADF,CAEEC,CAFF,CASIH,CATJ,CAEEG,cAFF,CAGEC,CAHF,CASIJ,CATJ,CAGEI,UAHF,CAIEC,CAJF,CASIL,CATJ,CAIEK,MAJF,CAKEC,CALF,CASIN,CATJ,CAKEM,OALF,CAMEC,CANF,CASIP,CATJ,CAMEO,IANF,CAOEC,CAPF,CASIR,CATJ,CAOEQ,MAPF,CAQKC,CARL,0BASIT,CATJ,YAWA,MACE,qBAAC,WAAD,kBACMS,CADN,EAEE,GAAG,CAAER,CAFP,CAGE,SAAS,CAAEH,oBAAoB,CAAC,IAAD,CAAO,CAACI,CAAD,CAAP,CAHjC,CAIE,gBAAeG,CAJjB,CAKE,IAAI,CAAC,QALP,CAME,MAAM,CAAEC,CANV,CAOE,IAAI,CAAEC,CAPR,CAQE,WAAW,CAAEC,CARf,CASE,KAAK,CACH,wCACGL,CADH,SACoB,6BAAIC,CAAJ,CADpB,QAVJ,GAgBH,CA9B4E,CAAxE"}
@@ -1,2 +1,2 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["controlRef","size","getOptionProps","dropdownRef","labelForCreate","className","labelForNotFound","labelForEmptyItems","hasItems","form","isOpen","offset","renderItem","visibleItems","isLoading","getGroupLabel","notFound","itemsRefs","virtualScroll","onScrollToBottom"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"./SelectDropdown.css";import React,{Fragment,useEffect,useMemo,useRef}from"react";import{Transition}from"react-transition-group";import{cnListBox,ListItem,ListLoader,mapVerticalSpase}from"../../ListCanary";import{Popover}from"../../Popover";import{useDebounce}from"../../../hooks/useDebounce";import{useFlag}from"../../../hooks/useFlag";import{forkRef,useForkRef}from"../../../hooks/useForkRef";import{useVirtualScroll}from"../../../hooks/useVirtualScroll";import{animateTimeout,cnMixPopoverAnimate}from"../../../mixs/MixPopoverAnimate/MixPopoverAnimate";import{cnMixScrollBar}from"../../../mixs/MixScrollBar";import{cnMixSpace}from"../../../mixs/MixSpace";import{cnCanary}from"../../../utils/bem";import{fabricIndex}from"../../../utils/fabricIndex";import{SelectCreateButton}from"../SelectCreateButton/SelectCreateButton";import{SelectGroupLabel}from"../SelectGroupLabel/SelectGroupLabel";import{SelectItemAll}from"../SelectItemAll/SelectSelectAll";import{SelectLoader}from"../SelectLoader/SelectLoader";import{isNotOptionForCreate,isOptionForCreate,isOptionForSelectAll}from"../useSelect";export var selectDropdownform=["default","brick","round"];export var defaultSelectDropdownPropForm=selectDropdownform[0];var cnSelectDropdown=cnCanary("SelectDropdown"),getLenghtElements=function(a){for(var b,c=1>=a.length?0:a.length,d=0;d<a.length;d++)b=a[d],isNotOptionForCreate(b)&&b.items.length&&(c+=b.items.length);return c},isVisible=function(a,b){return b>=a[0]&&b<a[1]};export var SelectDropdown=function(a){var b=a.controlRef,c=a.size,d=a.getOptionProps,e=a.dropdownRef,f=a.labelForCreate,g=a.className,h=a.labelForNotFound,i=a.labelForEmptyItems,j=a.hasItems,k=void 0===j||j,l=a.form,m=a.isOpen,n=a.offset,o=void 0===n?"none":n,p=a.renderItem,q=a.visibleItems,r=a.isLoading,s=a.getGroupLabel,t=a.notFound,u=a.itemsRefs,v=a.virtualScroll,w=a.onScrollToBottom,x=_objectWithoutProperties(a,_excluded),y="round"===l?"increased":"normal",z=useMemo(function(){return 0<q.filter(function(a){return isOptionForCreate(a)||Array.isArray(a.items)&&0<a.items.length}).length},[q]),A="none"===o?void 0:o,B=useMemo(function(){return getLenghtElements(q)},[q]),C=useVirtualScroll({length:B,isActive:v&&m,onScrollToBottom:w}),D=C.spaceTop,E=C.slice,F=C.listRefs,G=C.scrollElementRef,H=0===E[0]&&v?[0,50]:E,I=useRef(null),J=useForkRef([G,e]),K=useFlag(),L=_slicedToArray(K,2),M=L[0],N=L[1],O=useDebounce(N.off,100);return useEffect(function(){var a,b=function(){N.on(),O()};return null===(a=G.current)||void 0===a?void 0:a.addEventListener("scroll",b),function(){var a;null===(a=G.current)||void 0===a?void 0:a.removeEventListener("scroll",b)}},[G.current]),React.createElement(Transition,{in:m,unmountOnExit:!0,nodeRef:I,timeout:animateTimeout},function(a){var e=fabricIndex(),j=fabricIndex();return React.createElement(Popover,Object.assign({},x,{anchorRef:b,direction:"downStartLeft",possibleDirections:["downStartLeft","upStartLeft","downStartRight","upStartRight"],offset:A,ref:I,role:"listbox",className:cnSelectDropdown(null,[cnListBox({size:c,form:l,border:!0,shadow:!0}),cnMixPopoverAnimate({animate:a}),g]),equalAnchorWidth:!0}),React.createElement("div",{className:cnSelectDropdown("ScrollContainer",[cnMixSpace({pV:mapVerticalSpase[c]}),cnMixScrollBar()]),ref:J},r&&!z&&React.createElement(SelectLoader,null),React.createElement("div",{className:cnSelectDropdown("List",{scrolled:M}),style:{marginTop:D}},q.map(function(a){if(isOptionForCreate(a)){var g=e();return React.createElement(SelectCreateButton,Object.assign({size:c,labelForCreate:f,inputValue:a.label,indent:y,ref:u[g]},d({index:g,item:a,keyPrefix:D})))}var b=1<q.length?j():0;return React.createElement(Fragment,{key:a.key},a.group&&s&&isVisible(H,b)&&React.createElement(SelectGroupLabel,{label:s(a.group),size:c,indent:y,ref:F[b],key:"group".concat(a.key).concat(D)}),a.items.map(function(b,f){if(isOptionForSelectAll(b)){var g=j(),h=e();if(isVisible(H,g))return React.createElement(SelectItemAll,Object.assign({ref:forkRef([F[g],u[h]]),indent:y,size:c},d({index:h,item:b,keyPrefix:D}),{intermediate:!!(b.checkedCount&&b.totalCount)&&b.checkedCount!==b.totalCount,checked:b.checkedCount===b.totalCount,countItems:b.checkedCount,total:b.totalCount}))}else{var i=j(),k=e();if(isVisible(H,i))return React.createElement(Fragment,{key:"".concat(a.key,"-").concat(f)},p(_objectSpread({ref:forkRef([F[i],u[k]]),item:b},d({index:k,item:b,keyPrefix:D}))))}}))}),r&&z&&React.createElement(ListLoader,{size:c,innerOffset:y})),!r&&k&&t&&h&&React.createElement(ListItem,{size:c,label:h,innerOffset:y},h),!r&&!k&&i&&React.createElement(ListItem,{size:c,label:i,innerOffset:y},i)))})};
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["controlRef","size","getOptionProps","dropdownRef","labelForCreate","className","labelForNotFound","labelForEmptyItems","hasItems","form","isOpen","offset","renderItem","visibleItems","isLoading","getGroupLabel","notFound","itemsRefs","virtualScroll","onScrollToBottom"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"./SelectDropdown.css";import React,{Fragment,useEffect,useMemo,useRef}from"react";import{Transition}from"react-transition-group";import{cnListBox,ListItem,ListLoader,mapVerticalSpase}from"../../ListCanary";import{Popover}from"../../Popover";import{useDebounce}from"../../../hooks/useDebounce";import{useFlag}from"../../../hooks/useFlag";import{forkRef,useForkRef}from"../../../hooks/useForkRef";import{useVirtualScroll}from"../../../hooks/useVirtualScroll";import{animateTimeout,cnMixPopoverAnimate}from"../../../mixs/MixPopoverAnimate/MixPopoverAnimate";import{cnMixScrollBar}from"../../../mixs/MixScrollBar";import{cnMixSpace}from"../../../mixs/MixSpace";import{cn}from"../../../utils/bem";import{fabricIndex}from"../../../utils/fabricIndex";import{SelectCreateButton}from"../SelectCreateButton/SelectCreateButton";import{SelectGroupLabel}from"../SelectGroupLabel/SelectGroupLabel";import{SelectItemAll}from"../SelectItemAll/SelectItemAll";import{SelectLoader}from"../SelectLoader/SelectLoader";import{isNotOptionForCreate,isOptionForCreate,isOptionForSelectAll}from"../useSelect";export var selectDropdownform=["default","brick","round"];export var defaultSelectDropdownPropForm=selectDropdownform[0];var cnSelectDropdown=cn("SelectDropdown"),getLenghtElements=function(a){for(var b,c=1>=a.length?0:a.length,d=0;d<a.length;d++)b=a[d],isNotOptionForCreate(b)&&b.items.length&&(c+=b.items.length);return c},isVisible=function(a,b){return b>=a[0]&&b<a[1]};export var SelectDropdown=function(a){var b=a.controlRef,c=a.size,d=a.getOptionProps,e=a.dropdownRef,f=a.labelForCreate,g=a.className,h=a.labelForNotFound,i=a.labelForEmptyItems,j=a.hasItems,k=void 0===j||j,l=a.form,m=a.isOpen,n=a.offset,o=void 0===n?"none":n,p=a.renderItem,q=a.visibleItems,r=a.isLoading,s=a.getGroupLabel,t=a.notFound,u=a.itemsRefs,v=a.virtualScroll,w=a.onScrollToBottom,x=_objectWithoutProperties(a,_excluded),y="round"===l?"increased":"normal",z=useMemo(function(){return 0<q.filter(function(a){return isOptionForCreate(a)||Array.isArray(a.items)&&0<a.items.length}).length},[q]),A="none"===o?void 0:o,B=useMemo(function(){return getLenghtElements(q)},[q]),C=useVirtualScroll({length:B,isActive:v&&m,onScrollToBottom:w}),D=C.spaceTop,E=C.slice,F=C.listRefs,G=C.scrollElementRef,H=0===E[0]&&v?[0,50]:E,I=useRef(null),J=useForkRef([G,e]),K=useFlag(),L=_slicedToArray(K,2),M=L[0],N=L[1],O=useDebounce(N.off,100);return useEffect(function(){var a,b=function(){N.on(),O()};return null===(a=G.current)||void 0===a?void 0:a.addEventListener("scroll",b),function(){var a;null===(a=G.current)||void 0===a?void 0:a.removeEventListener("scroll",b)}},[G.current]),React.createElement(Transition,{in:m,unmountOnExit:!0,nodeRef:I,timeout:animateTimeout},function(a){var e=fabricIndex(),j=fabricIndex();return React.createElement(Popover,Object.assign({},x,{anchorRef:b,direction:"downStartLeft",possibleDirections:["downStartLeft","upStartLeft","downStartRight","upStartRight"],offset:A,ref:I,role:"listbox",className:cnSelectDropdown(null,[cnListBox({size:c,form:l,border:!0,shadow:!0}),cnMixPopoverAnimate({animate:a}),g]),equalAnchorWidth:!0}),React.createElement("div",{className:cnSelectDropdown("ScrollContainer",[cnMixSpace({pV:mapVerticalSpase[c]}),cnMixScrollBar()]),ref:J},r&&!z&&React.createElement(SelectLoader,null),React.createElement("div",{className:cnSelectDropdown("List",{scrolled:M}),style:{marginTop:D}},q.map(function(a){if(isOptionForCreate(a)){var g=e();return React.createElement(SelectCreateButton,Object.assign({size:c,labelForCreate:f,inputValue:a.label,indent:y,ref:u[g]},d({index:g,item:a,keyPrefix:D})))}var b=1<q.length?j():0;return React.createElement(Fragment,{key:a.key},a.group&&s&&isVisible(H,b)&&React.createElement(SelectGroupLabel,{label:s(a.group),size:c,indent:y,ref:F[b],key:"group".concat(a.key).concat(D)}),a.items.map(function(b,f){if(isOptionForSelectAll(b)){var g=j(),h=e();if(isVisible(H,g))return React.createElement(SelectItemAll,Object.assign({ref:forkRef([F[g],u[h]]),indent:y,size:c},d({index:h,item:b,keyPrefix:D}),{intermediate:!!(b.checkedCount&&b.totalCount)&&b.checkedCount!==b.totalCount,checked:b.checkedCount===b.totalCount,countItems:b.checkedCount,total:b.totalCount}))}else{var i=j(),k=e();if(isVisible(H,i))return React.createElement(Fragment,{key:"".concat(a.key,"-").concat(f)},p(_objectSpread({ref:forkRef([F[i],u[k]]),item:b},d({index:k,item:b,keyPrefix:D}))))}}))}),r&&z&&React.createElement(ListLoader,{size:c,innerOffset:y})),!r&&k&&t&&h&&React.createElement(ListItem,{size:c,label:h,innerOffset:y},h),!r&&!k&&i&&React.createElement(ListItem,{size:c,label:i,innerOffset:y},i)))})};
2
2
  //# sourceMappingURL=SelectDropdown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectDropdown.js","names":["React","Fragment","useEffect","useMemo","useRef","Transition","cnListBox","ListItem","ListLoader","mapVerticalSpase","Popover","useDebounce","useFlag","forkRef","useForkRef","useVirtualScroll","animateTimeout","cnMixPopoverAnimate","cnMixScrollBar","cnMixSpace","cnCanary","fabricIndex","SelectCreateButton","SelectGroupLabel","SelectItemAll","SelectLoader","isNotOptionForCreate","isOptionForCreate","isOptionForSelectAll","selectDropdownform","defaultSelectDropdownPropForm","cnSelectDropdown","getLenghtElements","elements","element","lenght","length","index","items","isVisible","slise","SelectDropdown","props","controlRef","size","getOptionProps","dropdownRefProp","dropdownRef","labelForCreate","className","labelForNotFound","labelForEmptyItems","hasItems","form","isOpen","offset","offsetProp","renderItem","visibleItems","isLoading","getGroupLabel","notFound","itemsRefs","virtualScroll","onScrollToBottom","otherProps","indent","isListShowed","filter","group","Array","isArray","lengthForVirtualScroll","isActive","spaceTop","sliceHookProp","slice","listRefs","scrollElementRef","popoverRef","scrolled","setScroled","setScroledOffDebouns","off","fn","on","current","addEventListener","removeEventListener","animate","getIndex","getVirtualIndex","border","shadow","pV","marginTop","map","label","item","keyPrefix","virtualIndex","key","i","checkedCount","totalCount","ref"],"sources":["../../../../../../src/components/SelectComponents/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["import './SelectDropdown.css';\n\nimport React, { Fragment, useEffect, useMemo, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport {\n cnListBox,\n ListItem,\n ListLoader,\n mapVerticalSpase,\n} from '##/components/ListCanary';\nimport { Popover, PopoverPropOffset } from '##/components/Popover';\nimport { useDebounce } from '##/hooks/useDebounce';\nimport { useFlag } from '##/hooks/useFlag';\nimport { forkRef, useForkRef } from '##/hooks/useForkRef';\nimport { useVirtualScroll } from '##/hooks/useVirtualScroll';\nimport {\n animateTimeout,\n cnMixPopoverAnimate,\n} from '##/mixs/MixPopoverAnimate/MixPopoverAnimate';\nimport { cnMixScrollBar } from '##/mixs/MixScrollBar';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cnCanary } from '##/utils/bem';\nimport { fabricIndex } from '##/utils/fabricIndex';\nimport { SelectAllItem } from '##/utils/getGroups';\nimport { PropsWithJsxAttributes } from '##/utils/types/PropsWithJsxAttributes';\n\nimport { SelectCreateButton } from '../SelectCreateButton/SelectCreateButton';\nimport { SelectGroupLabel } from '../SelectGroupLabel/SelectGroupLabel';\nimport { SelectItemAll } from '../SelectItemAll/SelectSelectAll';\nimport { SelectLoader } from '../SelectLoader/SelectLoader';\nimport { PropSize, RenderItemProps } from '../types';\nimport {\n GetOptionPropsResult,\n isNotOptionForCreate,\n isOptionForCreate,\n isOptionForSelectAll,\n OptionForCreate,\n OptionProps,\n} from '../useSelect';\n\nexport const selectDropdownform = ['default', 'brick', 'round'] as const;\nexport type SelectDropdownPropForm = typeof selectDropdownform[number];\nexport const defaultSelectDropdownPropForm = selectDropdownform[0];\n\ntype Props<ITEM, GROUP> = PropsWithJsxAttributes<{\n size: PropSize;\n controlRef: React.MutableRefObject<HTMLDivElement | null>;\n dropdownRef: React.Ref<HTMLDivElement>;\n getOptionProps(props: OptionProps<ITEM>): GetOptionPropsResult;\n form: SelectDropdownPropForm;\n isOpen: boolean;\n offset?: PopoverPropOffset | 'none';\n isLoading?: boolean;\n renderItem: (props: RenderItemProps<ITEM>) => JSX.Element | null;\n visibleItems: (\n | OptionForCreate\n | {\n items: Array<SelectAllItem | ITEM>;\n key: string | number;\n group?: GROUP;\n groupIndex: number;\n checkedCount?: number;\n totalCount?: number;\n }\n )[];\n getGroupLabel?: (group: GROUP) => string;\n labelForCreate?: string;\n labelForNotFound?: string;\n labelForEmptyItems?: string;\n notFound?: boolean;\n hasItems?: boolean;\n itemsRefs: React.RefObject<HTMLDivElement>[];\n virtualScroll?: boolean;\n onScrollToBottom?: () => void;\n}>;\n\ntype SelectDropdown = <ITEM, GROUP>(\n props: Props<ITEM, GROUP>,\n) => React.ReactElement | null;\n\nconst cnSelectDropdown = cnCanary('SelectDropdown');\n\nconst getLenghtElements = <ITEM, GROUP>(\n elements: (\n | OptionForCreate\n | {\n items: Array<SelectAllItem | ITEM>;\n key: string | number;\n group?: GROUP;\n groupIndex: number;\n checkedCount?: number;\n totalCount?: number;\n }\n )[],\n) => {\n let lenght = elements.length <= 1 ? 0 : elements.length;\n\n for (let index = 0; index < elements.length; index++) {\n const element = elements[index];\n\n if (isNotOptionForCreate(element) && element.items.length) {\n lenght += element.items.length;\n }\n }\n\n return lenght;\n};\n\nconst isVisible = (slise: [number, number], index: number) => {\n return index >= slise[0] && index < slise[1];\n};\n\nexport const SelectDropdown: SelectDropdown = (props) => {\n const {\n controlRef,\n size,\n getOptionProps,\n dropdownRef: dropdownRefProp,\n labelForCreate,\n className,\n labelForNotFound,\n labelForEmptyItems,\n hasItems = true,\n form,\n isOpen,\n offset: offsetProp = 'none',\n renderItem,\n visibleItems,\n isLoading,\n getGroupLabel,\n notFound,\n itemsRefs,\n virtualScroll,\n onScrollToBottom,\n ...otherProps\n } = props;\n\n const indent = form === 'round' ? 'increased' : 'normal';\n\n const isListShowed = useMemo(() => {\n return (\n visibleItems.filter(\n (group) =>\n isOptionForCreate(group) ||\n (Array.isArray(group.items) && group.items.length > 0),\n ).length > 0\n );\n }, [visibleItems]);\n\n const offset = offsetProp === 'none' ? undefined : offsetProp;\n\n const lengthForVirtualScroll = useMemo(\n () => getLenghtElements(visibleItems),\n [visibleItems],\n );\n\n const {\n spaceTop,\n slice: sliceHookProp,\n listRefs,\n scrollElementRef,\n } = useVirtualScroll({\n length: lengthForVirtualScroll,\n isActive: virtualScroll && isOpen,\n onScrollToBottom,\n });\n\n const slice: [number, number] =\n sliceHookProp[0] === 0 && virtualScroll ? [0, 50] : sliceHookProp;\n\n const popoverRef = useRef<HTMLDivElement>(null);\n const dropdownRef = useForkRef([scrollElementRef, dropdownRefProp]);\n const [scrolled, setScroled] = useFlag();\n const setScroledOffDebouns = useDebounce(setScroled.off, 100);\n\n useEffect(() => {\n const fn = () => {\n setScroled.on();\n setScroledOffDebouns();\n };\n\n scrollElementRef.current?.addEventListener('scroll', fn);\n\n return () => {\n scrollElementRef.current?.removeEventListener('scroll', fn);\n };\n }, [scrollElementRef.current]);\n\n return (\n <Transition\n in={isOpen}\n unmountOnExit\n nodeRef={popoverRef}\n timeout={animateTimeout}\n >\n {(animate) => {\n const getIndex = fabricIndex();\n const getVirtualIndex = fabricIndex();\n\n return (\n <Popover\n {...otherProps}\n anchorRef={controlRef}\n direction=\"downStartLeft\"\n possibleDirections={[\n 'downStartLeft',\n 'upStartLeft',\n 'downStartRight',\n 'upStartRight',\n ]}\n offset={offset}\n ref={popoverRef}\n role=\"listbox\"\n className={cnSelectDropdown(null, [\n cnListBox({ size, form, border: true, shadow: true }),\n cnMixPopoverAnimate({ animate }),\n className,\n ])}\n equalAnchorWidth\n >\n <div\n className={cnSelectDropdown('ScrollContainer', [\n cnMixSpace({\n pV: mapVerticalSpase[size],\n }),\n cnMixScrollBar(),\n ])}\n ref={dropdownRef}\n >\n {isLoading && !isListShowed && <SelectLoader />}\n <div\n className={cnSelectDropdown('List', { scrolled })}\n style={{ marginTop: spaceTop }}\n >\n {visibleItems.map((group) => {\n if (isOptionForCreate(group)) {\n const index = getIndex();\n return (\n <SelectCreateButton\n size={size}\n labelForCreate={labelForCreate}\n inputValue={group.label}\n indent={indent}\n ref={itemsRefs[index]}\n {...getOptionProps({\n index,\n item: group,\n keyPrefix: spaceTop,\n })}\n />\n );\n }\n\n const virtualIndex =\n visibleItems.length > 1 ? getVirtualIndex() : 0;\n\n return (\n <Fragment key={group.key}>\n {group.group &&\n getGroupLabel &&\n isVisible(slice, virtualIndex) && (\n <SelectGroupLabel\n label={getGroupLabel(group.group)}\n size={size}\n indent={indent}\n ref={listRefs[virtualIndex]}\n key={`group${group.key}${spaceTop}`}\n />\n )}\n {group.items.map((item, i) => {\n if (isOptionForSelectAll(item)) {\n const virtualIndex = getVirtualIndex();\n const index = getIndex();\n\n if (isVisible(slice, virtualIndex)) {\n return (\n <SelectItemAll\n ref={forkRef([\n listRefs[virtualIndex],\n itemsRefs[index],\n ])}\n indent={indent}\n size={size}\n {...getOptionProps({\n index,\n item,\n keyPrefix: spaceTop,\n })}\n intermediate={\n item.checkedCount && item.totalCount\n ? item.checkedCount !== item.totalCount\n : false\n }\n checked={item.checkedCount === item.totalCount}\n countItems={item.checkedCount}\n total={item.totalCount}\n />\n );\n }\n } else {\n const virtualIndex = getVirtualIndex();\n const index = getIndex();\n if (isVisible(slice, virtualIndex)) {\n return (\n <Fragment key={`${group.key}-${i}`}>\n {renderItem({\n ref: forkRef([\n listRefs[virtualIndex],\n itemsRefs[index],\n ]),\n item,\n ...getOptionProps({\n index,\n item,\n keyPrefix: spaceTop,\n }),\n })}\n </Fragment>\n );\n }\n }\n })}\n </Fragment>\n );\n })}\n {isLoading && isListShowed && (\n <ListLoader size={size} innerOffset={indent} />\n )}\n </div>\n {!isLoading && hasItems && notFound && labelForNotFound && (\n <ListItem\n size={size}\n label={labelForNotFound}\n innerOffset={indent}\n >\n {labelForNotFound}\n </ListItem>\n )}\n {!isLoading && !hasItems && labelForEmptyItems && (\n <ListItem\n size={size}\n label={labelForEmptyItems}\n innerOffset={indent}\n >\n {labelForEmptyItems}\n </ListItem>\n )}\n </div>\n </Popover>\n );\n }}\n </Transition>\n );\n};\n"],"mappings":"ylCAAA,6BAEA,MAAOA,MAAP,EAAgBC,QAAhB,CAA0BC,SAA1B,CAAqCC,OAArC,CAA8CC,MAA9C,KAA4D,OAA5D,CACA,OAASC,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CAJH,CA+FGf,CAAS,EAAIQ,CAAb,EACC,oBAAC,UAAD,EAAY,IAAI,CAAEvB,CAAlB,CAAwB,WAAW,CAAEsB,CAArC,EAhGJ,CAVF,CA6GG,CAACP,CAAD,EAAcP,CAAd,EAA0BS,CAA1B,EAAsCX,CAAtC,EACC,oBAAC,QAAD,EACE,IAAI,CAAEN,CADR,CAEE,KAAK,CAAEM,CAFT,CAGE,WAAW,CAAEgB,CAHf,EAKGhB,CALH,CA9GJ,CAsHG,CAACS,CAAD,EAAc,CAACP,CAAf,EAA2BD,CAA3B,EACC,oBAAC,QAAD,EACE,IAAI,CAAEP,CADR,CAEE,KAAK,CAAEO,CAFT,CAGE,WAAW,CAAEe,CAHf,EAKGf,CALH,CAvHJ,CApBF,CAsJH,CAjKH,CAoKH,CAjPM"}
1
+ {"version":3,"file":"SelectDropdown.js","names":["React","Fragment","useEffect","useMemo","useRef","Transition","cnListBox","ListItem","ListLoader","mapVerticalSpase","Popover","useDebounce","useFlag","forkRef","useForkRef","useVirtualScroll","animateTimeout","cnMixPopoverAnimate","cnMixScrollBar","cnMixSpace","cn","fabricIndex","SelectCreateButton","SelectGroupLabel","SelectItemAll","SelectLoader","isNotOptionForCreate","isOptionForCreate","isOptionForSelectAll","selectDropdownform","defaultSelectDropdownPropForm","cnSelectDropdown","getLenghtElements","elements","element","lenght","length","index","items","isVisible","slise","SelectDropdown","props","controlRef","size","getOptionProps","dropdownRefProp","dropdownRef","labelForCreate","className","labelForNotFound","labelForEmptyItems","hasItems","form","isOpen","offset","offsetProp","renderItem","visibleItems","isLoading","getGroupLabel","notFound","itemsRefs","virtualScroll","onScrollToBottom","otherProps","indent","isListShowed","filter","group","Array","isArray","lengthForVirtualScroll","isActive","spaceTop","sliceHookProp","slice","listRefs","scrollElementRef","popoverRef","scrolled","setScroled","setScroledOffDebouns","off","fn","on","current","addEventListener","removeEventListener","animate","getIndex","getVirtualIndex","border","shadow","pV","marginTop","map","label","item","keyPrefix","virtualIndex","key","i","checkedCount","totalCount","ref"],"sources":["../../../../../../src/components/SelectComponents/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["import './SelectDropdown.css';\n\nimport React, { Fragment, useEffect, useMemo, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport {\n cnListBox,\n ListItem,\n ListLoader,\n mapVerticalSpase,\n} from '##/components/ListCanary';\nimport { Popover, PopoverPropOffset } from '##/components/Popover';\nimport { useDebounce } from '##/hooks/useDebounce';\nimport { useFlag } from '##/hooks/useFlag';\nimport { forkRef, useForkRef } from '##/hooks/useForkRef';\nimport { useVirtualScroll } from '##/hooks/useVirtualScroll';\nimport {\n animateTimeout,\n cnMixPopoverAnimate,\n} from '##/mixs/MixPopoverAnimate/MixPopoverAnimate';\nimport { cnMixScrollBar } from '##/mixs/MixScrollBar';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\nimport { fabricIndex } from '##/utils/fabricIndex';\nimport { SelectAllItem } from '##/utils/getGroups';\nimport { PropsWithJsxAttributes } from '##/utils/types/PropsWithJsxAttributes';\n\nimport { SelectCreateButton } from '../SelectCreateButton/SelectCreateButton';\nimport { SelectGroupLabel } from '../SelectGroupLabel/SelectGroupLabel';\nimport { SelectItemAll } from '../SelectItemAll/SelectItemAll';\nimport { SelectLoader } from '../SelectLoader/SelectLoader';\nimport { PropSize, RenderItemProps } from '../types';\nimport {\n GetOptionPropsResult,\n isNotOptionForCreate,\n isOptionForCreate,\n isOptionForSelectAll,\n OptionForCreate,\n OptionProps,\n} from '../useSelect';\n\nexport const selectDropdownform = ['default', 'brick', 'round'] as const;\nexport type SelectDropdownPropForm = typeof selectDropdownform[number];\nexport const defaultSelectDropdownPropForm = selectDropdownform[0];\n\ntype Props<ITEM, GROUP> = PropsWithJsxAttributes<{\n size: PropSize;\n controlRef: React.MutableRefObject<HTMLDivElement | null>;\n dropdownRef: React.Ref<HTMLDivElement>;\n getOptionProps(props: OptionProps<ITEM>): GetOptionPropsResult;\n form: SelectDropdownPropForm;\n isOpen: boolean;\n offset?: PopoverPropOffset | 'none';\n isLoading?: boolean;\n renderItem: (props: RenderItemProps<ITEM>) => JSX.Element | null;\n visibleItems: (\n | OptionForCreate\n | {\n items: Array<SelectAllItem | ITEM>;\n key: string | number;\n group?: GROUP;\n groupIndex: number;\n checkedCount?: number;\n totalCount?: number;\n }\n )[];\n getGroupLabel?: (group: GROUP) => string;\n labelForCreate?: string;\n labelForNotFound?: string;\n labelForEmptyItems?: string;\n notFound?: boolean;\n hasItems?: boolean;\n itemsRefs: React.RefObject<HTMLDivElement>[];\n virtualScroll?: boolean;\n onScrollToBottom?: () => void;\n}>;\n\ntype SelectDropdown = <ITEM, GROUP>(\n props: Props<ITEM, GROUP>,\n) => React.ReactElement | null;\n\nconst cnSelectDropdown = cn('SelectDropdown');\n\nconst getLenghtElements = <ITEM, GROUP>(\n elements: (\n | OptionForCreate\n | {\n items: Array<SelectAllItem | ITEM>;\n key: string | number;\n group?: GROUP;\n groupIndex: number;\n checkedCount?: number;\n totalCount?: number;\n }\n )[],\n) => {\n let lenght = elements.length <= 1 ? 0 : elements.length;\n\n for (let index = 0; index < elements.length; index++) {\n const element = elements[index];\n\n if (isNotOptionForCreate(element) && element.items.length) {\n lenght += element.items.length;\n }\n }\n\n return lenght;\n};\n\nconst isVisible = (slise: [number, number], index: number) => {\n return index >= slise[0] && index < slise[1];\n};\n\nexport const SelectDropdown: SelectDropdown = (props) => {\n const {\n controlRef,\n size,\n getOptionProps,\n dropdownRef: dropdownRefProp,\n labelForCreate,\n className,\n labelForNotFound,\n labelForEmptyItems,\n hasItems = true,\n form,\n isOpen,\n offset: offsetProp = 'none',\n renderItem,\n visibleItems,\n isLoading,\n getGroupLabel,\n notFound,\n itemsRefs,\n virtualScroll,\n onScrollToBottom,\n ...otherProps\n } = props;\n\n const indent = form === 'round' ? 'increased' : 'normal';\n\n const isListShowed = useMemo(() => {\n return (\n visibleItems.filter(\n (group) =>\n isOptionForCreate(group) ||\n (Array.isArray(group.items) && group.items.length > 0),\n ).length > 0\n );\n }, [visibleItems]);\n\n const offset = offsetProp === 'none' ? undefined : offsetProp;\n\n const lengthForVirtualScroll = useMemo(\n () => getLenghtElements(visibleItems),\n [visibleItems],\n );\n\n const {\n spaceTop,\n slice: sliceHookProp,\n listRefs,\n scrollElementRef,\n } = useVirtualScroll({\n length: lengthForVirtualScroll,\n isActive: virtualScroll && isOpen,\n onScrollToBottom,\n });\n\n const slice: [number, number] =\n sliceHookProp[0] === 0 && virtualScroll ? [0, 50] : sliceHookProp;\n\n const popoverRef = useRef<HTMLDivElement>(null);\n const dropdownRef = useForkRef([scrollElementRef, dropdownRefProp]);\n const [scrolled, setScroled] = useFlag();\n const setScroledOffDebouns = useDebounce(setScroled.off, 100);\n\n useEffect(() => {\n const fn = () => {\n setScroled.on();\n setScroledOffDebouns();\n };\n\n scrollElementRef.current?.addEventListener('scroll', fn);\n\n return () => {\n scrollElementRef.current?.removeEventListener('scroll', fn);\n };\n }, [scrollElementRef.current]);\n\n return (\n <Transition\n in={isOpen}\n unmountOnExit\n nodeRef={popoverRef}\n timeout={animateTimeout}\n >\n {(animate) => {\n const getIndex = fabricIndex();\n const getVirtualIndex = fabricIndex();\n\n return (\n <Popover\n {...otherProps}\n anchorRef={controlRef}\n direction=\"downStartLeft\"\n possibleDirections={[\n 'downStartLeft',\n 'upStartLeft',\n 'downStartRight',\n 'upStartRight',\n ]}\n offset={offset}\n ref={popoverRef}\n role=\"listbox\"\n className={cnSelectDropdown(null, [\n cnListBox({ size, form, border: true, shadow: true }),\n cnMixPopoverAnimate({ animate }),\n className,\n ])}\n equalAnchorWidth\n >\n <div\n className={cnSelectDropdown('ScrollContainer', [\n cnMixSpace({\n pV: mapVerticalSpase[size],\n }),\n cnMixScrollBar(),\n ])}\n ref={dropdownRef}\n >\n {isLoading && !isListShowed && <SelectLoader />}\n <div\n className={cnSelectDropdown('List', { scrolled })}\n style={{ marginTop: spaceTop }}\n >\n {visibleItems.map((group) => {\n if (isOptionForCreate(group)) {\n const index = getIndex();\n return (\n <SelectCreateButton\n size={size}\n labelForCreate={labelForCreate}\n inputValue={group.label}\n indent={indent}\n ref={itemsRefs[index]}\n {...getOptionProps({\n index,\n item: group,\n keyPrefix: spaceTop,\n })}\n />\n );\n }\n\n const virtualIndex =\n visibleItems.length > 1 ? getVirtualIndex() : 0;\n\n return (\n <Fragment key={group.key}>\n {group.group &&\n getGroupLabel &&\n isVisible(slice, virtualIndex) && (\n <SelectGroupLabel\n label={getGroupLabel(group.group)}\n size={size}\n indent={indent}\n ref={listRefs[virtualIndex]}\n key={`group${group.key}${spaceTop}`}\n />\n )}\n {group.items.map((item, i) => {\n if (isOptionForSelectAll(item)) {\n const virtualIndex = getVirtualIndex();\n const index = getIndex();\n\n if (isVisible(slice, virtualIndex)) {\n return (\n <SelectItemAll\n ref={forkRef([\n listRefs[virtualIndex],\n itemsRefs[index],\n ])}\n indent={indent}\n size={size}\n {...getOptionProps({\n index,\n item,\n keyPrefix: spaceTop,\n })}\n intermediate={\n item.checkedCount && item.totalCount\n ? item.checkedCount !== item.totalCount\n : false\n }\n checked={item.checkedCount === item.totalCount}\n countItems={item.checkedCount}\n total={item.totalCount}\n />\n );\n }\n } else {\n const virtualIndex = getVirtualIndex();\n const index = getIndex();\n if (isVisible(slice, virtualIndex)) {\n return (\n <Fragment key={`${group.key}-${i}`}>\n {renderItem({\n ref: forkRef([\n listRefs[virtualIndex],\n itemsRefs[index],\n ]),\n item,\n ...getOptionProps({\n index,\n item,\n keyPrefix: spaceTop,\n }),\n })}\n </Fragment>\n );\n }\n }\n })}\n </Fragment>\n );\n })}\n {isLoading && isListShowed && (\n <ListLoader size={size} innerOffset={indent} />\n )}\n </div>\n {!isLoading && hasItems && notFound && labelForNotFound && (\n <ListItem\n size={size}\n label={labelForNotFound}\n innerOffset={indent}\n >\n {labelForNotFound}\n </ListItem>\n )}\n {!isLoading && !hasItems && labelForEmptyItems && (\n <ListItem\n size={size}\n label={labelForEmptyItems}\n innerOffset={indent}\n >\n {labelForEmptyItems}\n </ListItem>\n )}\n </div>\n </Popover>\n );\n }}\n </Transition>\n );\n};\n"],"mappings":"ylCAAA,6BAEA,MAAOA,MAAP,EAAgBC,QAAhB,CAA0BC,SAA1B,CAAqCC,OAArC,CAA8CC,MAA9C,KAA4D,OAA5D,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAEA,OACEC,SADF,CAEEC,QAFF,CAGEC,UAHF,CAIEC,gBAJF,wBAMA,OAASC,OAAT,qBACA,OAASC,WAAT,kCACA,OAASC,OAAT,8BACA,OAASC,OAAT,CAAkBC,UAAlB,iCACA,OAASC,gBAAT,uCACA,OACEC,cADF,CAEEC,mBAFF,yDAIA,OAASC,cAAT,kCACA,OAASC,UAAT,8BACA,OAASC,EAAT,0BACA,OAASC,WAAT,kCAIA,OAASC,kBAAT,gDACA,OAASC,gBAAT,4CACA,OAASC,aAAT,sCACA,OAASC,YAAT,oCAEA,OAEEC,oBAFF,CAGEC,iBAHF,CAIEC,oBAJF,oBASA,MAAO,IAAMC,mBAAkB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,OAArB,CAA3B,CAEP,MAAO,IAAMC,8BAA6B,CAAGD,kBAAkB,CAAC,CAAD,CAAxD,C,GAsCDE,iBAAgB,CAAGX,EAAE,CAAC,gBAAD,C,CAErBY,iBAAiB,CAAG,SACxBC,CADwB,CAYrB,CAGH,OACQC,EADR,CAFIC,CAAM,CAAsB,CAAnB,EAAAF,CAAQ,CAACG,MAAT,CAAuB,CAAvB,CAA2BH,CAAQ,CAACG,MAEjD,CAASC,CAAK,CAAG,CAAjB,CAAoBA,CAAK,CAAGJ,CAAQ,CAACG,MAArC,CAA6CC,CAAK,EAAlD,CACQH,CADR,CACkBD,CAAQ,CAACI,CAAD,CAD1B,CAGMX,oBAAoB,CAACQ,CAAD,CAApB,EAAiCA,CAAO,CAACI,KAAR,CAAcF,MAHrD,GAIID,CAAM,EAAID,CAAO,CAACI,KAAR,CAA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CAACzB,CAAD,CAFE,CAAD,CADH,CAKT6D,IAAI,CAAJA,CALS,EAMNrD,CAAc,CAAC,CAChBR,KAAK,CAALA,CADgB,CAEhB6D,IAAI,CAAJA,CAFgB,CAGhBC,SAAS,CAAEzB,CAHK,CAAD,CANR,EADb,CAgBL,CACF,CApDA,CAZH,CAmEH,CA1FA,CAJH,CA+FGf,CAAS,EAAIQ,CAAb,EACC,oBAAC,UAAD,EAAY,IAAI,CAAEvB,CAAlB,CAAwB,WAAW,CAAEsB,CAArC,EAhGJ,CAVF,CA6GG,CAACP,CAAD,EAAcP,CAAd,EAA0BS,CAA1B,EAAsCX,CAAtC,EACC,oBAAC,QAAD,EACE,IAAI,CAAEN,CADR,CAEE,KAAK,CAAEM,CAFT,CAGE,WAAW,CAAEgB,CAHf,EAKGhB,CALH,CA9GJ,CAsHG,CAACS,CAAD,EAAc,CAACP,CAAf,EAA2BD,CAA3B,EACC,oBAAC,QAAD,EACE,IAAI,CAAEP,CADR,CAEE,KAAK,CAAEO,CAFT,CAGE,WAAW,CAAEe,CAHf,EAKGf,CALH,CAvHJ,CApBF,CAsJH,CAjKH,CAoKH,CAjPM"}
@@ -1,2 +1,2 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","label","active","hovered","multiple","size","indent","disabled"];import"./SelectItem.css";import React,{forwardRef}from"react";import{Checkbox}from"../../Checkbox";import{ListItem}from"../../ListCanary";import{cnCanary}from"../../../utils/bem";export var sizeCheckboxMap={xs:"m",s:"m",m:"l",l:"l"};export var cnSelectItem=cnCanary("SelectItem");export var SelectItem=forwardRef(function(a,b){var c=a.className,d=a.label,e=a.active,f=a.hovered,g=a.multiple,h=a.size,i=a.indent,j=a.disabled,k=_objectWithoutProperties(a,_excluded);return React.createElement(ListItem,Object.assign({},k,{ref:b,className:cnSelectItem(null,[c]),"aria-selected":e,"aria-disabled":j,role:"option",label:d,innerOffset:i,size:h,active:f,checked:!g&&e,disabled:j,leftSide:g&&React.createElement(Checkbox,{checked:e,disabled:j,size:sizeCheckboxMap[h]})}),d)});
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","label","active","hovered","multiple","size","indent","disabled","onClick"];import"./SelectItem.css";import React,{forwardRef}from"react";import{Checkbox}from"../../Checkbox";import{ListItem}from"../../ListCanary";import{cn}from"../../../utils/bem";export var sizeCheckboxMap={xs:"m",s:"m",m:"l",l:"l"};export var cnSelectItem=cn("SelectItem");export var SelectItem=forwardRef(function(a,b){var c=a.className,d=a.label,e=a.active,f=a.hovered,g=a.multiple,h=a.size,i=a.indent,j=a.disabled,k=a.onClick,l=_objectWithoutProperties(a,_excluded);return React.createElement(ListItem,Object.assign({},l,{ref:b,className:cnSelectItem(null,[c]),"aria-selected":e,"aria-disabled":j,role:"option",label:d,innerOffset:i,size:h,active:f,checked:!g&&e,disabled:j,onClick:k,leftSide:g&&React.createElement(Checkbox,{checked:e,disabled:j,size:sizeCheckboxMap[h]})}),d)});
2
2
  //# sourceMappingURL=SelectItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectItem.js","names":["React","forwardRef","Checkbox","ListItem","cnCanary","sizeCheckboxMap","xs","s","m","l","cnSelectItem","SelectItem","props","ref","className","label","active","hovered","multiple","size","indent","disabled","otherProps"],"sources":["../../../../../../src/components/SelectComponents/SelectItem/SelectItem.tsx"],"sourcesContent":["import './SelectItem.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { Checkbox, CheckboxPropSize } from '##/components/Checkbox';\nimport { ListItem } from '##/components/ListCanary';\nimport { cnCanary } from '##/utils/bem';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nimport { PropSize } from '../types';\n\nexport type SelectItemProps = PropsWithHTMLAttributesAndRef<\n {\n label: string;\n active: boolean;\n hovered: boolean;\n multiple: boolean;\n size: PropSize;\n indent: 'normal' | 'increased';\n disabled: boolean | undefined;\n },\n HTMLDivElement\n>;\n\nexport const sizeCheckboxMap: Record<PropSize, CheckboxPropSize> = {\n xs: 'm',\n s: 'm',\n m: 'l',\n l: 'l',\n};\n\nexport const cnSelectItem = cnCanary('SelectItem');\n\nexport const SelectItem: React.FC<SelectItemProps> = forwardRef(\n (props, ref) => {\n const {\n className,\n label,\n active,\n hovered,\n multiple,\n size,\n indent,\n disabled,\n ...otherProps\n } = props;\n\n return (\n <ListItem\n {...otherProps}\n ref={ref}\n className={cnSelectItem(null, [className])}\n aria-selected={active}\n aria-disabled={disabled}\n role=\"option\"\n label={label}\n innerOffset={indent}\n size={size}\n active={hovered}\n checked={!multiple && active}\n disabled={disabled}\n leftSide={\n multiple && (\n <Checkbox\n checked={active}\n disabled={disabled}\n size={sizeCheckboxMap[size]}\n />\n )\n }\n >\n {label}\n </ListItem>\n );\n },\n);\n"],"mappings":"kLAAA,yBAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,QAAT,sBACA,OAASC,QAAT,wBACA,OAASC,QAAT,0BAkBA,MAAO,IAAMC,gBAAmD,CAAG,CACjEC,EAAE,CAAE,GAD6D,CAEjEC,CAAC,CAAE,GAF8D,CAGjEC,CAAC,CAAE,GAH8D,CAIjEC,CAAC,CAAE,GAJ8D,CAA5D,CAOP,MAAO,IAAMC,aAAY,CAAGN,QAAQ,CAAC,YAAD,CAA7B,CAEP,MAAO,IAAMO,WAAqC,CAAGV,UAAU,CAC7D,SAACW,CAAD,CAAQC,CAAR,CAAgB,CACd,GACEC,EADF,CAUIF,CAVJ,CACEE,SADF,CAEEC,CAFF,CAUIH,CAVJ,CAEEG,KAFF,CAGEC,CAHF,CAUIJ,CAVJ,CAGEI,MAHF,CAIEC,CAJF,CAUIL,CAVJ,CAIEK,OAJF,CAKEC,CALF,CAUIN,CAVJ,CAKEM,QALF,CAMEC,CANF,CAUIP,CAVJ,CAMEO,IANF,CAOEC,CAPF,CAUIR,CAVJ,CAOEQ,MAPF,CAQEC,CARF,CAUIT,CAVJ,CAQES,QARF,CASKC,CATL,0BAUIV,CAVJ,YAYA,MACE,qBAAC,QAAD,kBACMU,CADN,EAEE,GAAG,CAAET,CAFP,CAGE,SAAS,CAAEH,YAAY,CAAC,IAAD,CAAO,CAACI,CAAD,CAAP,CAHzB,CAIE,gBAAeE,CAJjB,CAKE,gBAAeK,CALjB,CAME,IAAI,CAAC,QANP,CAOE,KAAK,CAAEN,CAPT,CAQE,WAAW,CAAEK,CARf,CASE,IAAI,CAAED,CATR,CAUE,MAAM,CAAEF,CAVV,CAWE,OAAO,CAAE,CAACC,CAAD,EAAaF,CAXxB,CAYE,QAAQ,CAAEK,CAZZ,CAaE,QAAQ,CACNH,CAAQ,EACN,oBAAC,QAAD,EACE,OAAO,CAAEF,CADX,CAEE,QAAQ,CAAEK,CAFZ,CAGE,IAAI,CAAEhB,eAAe,CAACc,CAAD,CAHvB,EAfN,GAuBGJ,CAvBH,CA0BH,CAzC4D,CAAxD"}
1
+ {"version":3,"file":"SelectItem.js","names":["React","forwardRef","Checkbox","ListItem","cn","sizeCheckboxMap","xs","s","m","l","cnSelectItem","SelectItem","props","ref","className","label","active","hovered","multiple","size","indent","disabled","onClick","otherProps"],"sources":["../../../../../../src/components/SelectComponents/SelectItem/SelectItem.tsx"],"sourcesContent":["import './SelectItem.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { Checkbox, CheckboxPropSize } from '##/components/Checkbox';\nimport { ListItem } from '##/components/ListCanary';\nimport { cn } from '##/utils/bem';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nimport { PropSize } from '../types';\n\nexport type SelectItemProps = PropsWithHTMLAttributesAndRef<\n {\n label: string;\n active: boolean;\n hovered: boolean;\n multiple: boolean;\n size: PropSize;\n indent: 'normal' | 'increased';\n disabled: boolean | undefined;\n },\n HTMLDivElement\n>;\n\nexport const sizeCheckboxMap: Record<PropSize, CheckboxPropSize> = {\n xs: 'm',\n s: 'm',\n m: 'l',\n l: 'l',\n};\n\nexport const cnSelectItem = cn('SelectItem');\n\nexport const SelectItem: React.FC<SelectItemProps> = forwardRef(\n (props, ref) => {\n const {\n className,\n label,\n active,\n hovered,\n multiple,\n size,\n indent,\n disabled,\n onClick,\n ...otherProps\n } = props;\n\n return (\n <ListItem\n {...otherProps}\n ref={ref}\n className={cnSelectItem(null, [className])}\n aria-selected={active}\n aria-disabled={disabled}\n role=\"option\"\n label={label}\n innerOffset={indent}\n size={size}\n active={hovered}\n checked={!multiple && active}\n disabled={disabled}\n onClick={onClick}\n leftSide={\n multiple && (\n <Checkbox\n checked={active}\n disabled={disabled}\n size={sizeCheckboxMap[size]}\n />\n )\n }\n >\n {label}\n </ListItem>\n );\n },\n);\n"],"mappings":"4LAAA,yBAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,QAAT,sBACA,OAASC,QAAT,wBACA,OAASC,EAAT,0BAkBA,MAAO,IAAMC,gBAAmD,CAAG,CACjEC,EAAE,CAAE,GAD6D,CAEjEC,CAAC,CAAE,GAF8D,CAGjEC,CAAC,CAAE,GAH8D,CAIjEC,CAAC,CAAE,GAJ8D,CAA5D,CAOP,MAAO,IAAMC,aAAY,CAAGN,EAAE,CAAC,YAAD,CAAvB,CAEP,MAAO,IAAMO,WAAqC,CAAGV,UAAU,CAC7D,SAACW,CAAD,CAAQC,CAAR,CAAgB,CACd,GACEC,EADF,CAWIF,CAXJ,CACEE,SADF,CAEEC,CAFF,CAWIH,CAXJ,CAEEG,KAFF,CAGEC,CAHF,CAWIJ,CAXJ,CAGEI,MAHF,CAIEC,CAJF,CAWIL,CAXJ,CAIEK,OAJF,CAKEC,CALF,CAWIN,CAXJ,CAKEM,QALF,CAMEC,CANF,CAWIP,CAXJ,CAMEO,IANF,CAOEC,CAPF,CAWIR,CAXJ,CAOEQ,MAPF,CAQEC,CARF,CAWIT,CAXJ,CAQES,QARF,CASEC,CATF,CAWIV,CAXJ,CASEU,OATF,CAUKC,CAVL,0BAWIX,CAXJ,YAaA,MACE,qBAAC,QAAD,kBACMW,CADN,EAEE,GAAG,CAAEV,CAFP,CAGE,SAAS,CAAEH,YAAY,CAAC,IAAD,CAAO,CAACI,CAAD,CAAP,CAHzB,CAIE,gBAAeE,CAJjB,CAKE,gBAAeK,CALjB,CAME,IAAI,CAAC,QANP,CAOE,KAAK,CAAEN,CAPT,CAQE,WAAW,CAAEK,CARf,CASE,IAAI,CAAED,CATR,CAUE,MAAM,CAAEF,CAVV,CAWE,OAAO,CAAE,CAACC,CAAD,EAAaF,CAXxB,CAYE,QAAQ,CAAEK,CAZZ,CAaE,OAAO,CAAEC,CAbX,CAcE,QAAQ,CACNJ,CAAQ,EACN,oBAAC,QAAD,EACE,OAAO,CAAEF,CADX,CAEE,QAAQ,CAAEK,CAFZ,CAGE,IAAI,CAAEhB,eAAe,CAACc,CAAD,CAHvB,EAhBN,GAwBGJ,CAxBH,CA2BH,CA3C4D,CAAxD"}
@@ -0,0 +1,2 @@
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","intermediate","size","indent","hovered","countItems","className","total"];import React,{forwardRef}from"react";import{ListItem}from"../../ListCanary";import{Text}from"../../Text";import{cn}from"../../../utils/bem";import{Checkbox}from"../../Checkbox/Checkbox";import{sizeCheckboxMap}from"../SelectItem/SelectItem";export var cnSelectItemAll=cn("SelectItemAll");var textSizeMap={xs:"s",s:"s",m:"m",l:"l"};export var SelectItemAll=forwardRef(function(a,b){var c=a.checked,d=a.intermediate,e=a.size,f=a.indent,g=a.hovered,h=a.countItems,i=void 0===h?0:h,j=a.className,k=a.total,l=void 0===k?0:k,m=_objectWithoutProperties(a,_excluded);return React.createElement(ListItem,Object.assign({},m,{ref:b,className:cnSelectItemAll(null,[j]),"aria-selected":c,role:"option",label:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435",innerOffset:f,size:e,active:g,rightSide:React.createElement(Text,{size:textSizeMap[e],lineHeight:"xs",view:"ghost"},"".concat(i," \u0438\u0437 ").concat(l)),leftSide:React.createElement(Checkbox,{checked:c,intermediate:d,size:sizeCheckboxMap[e]})}),"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435")});
2
+ //# sourceMappingURL=SelectItemAll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectItemAll.js","names":["React","forwardRef","ListItem","Text","cn","Checkbox","sizeCheckboxMap","cnSelectItemAll","textSizeMap","xs","s","m","l","SelectItemAll","props","ref","checked","intermediate","size","indent","hovered","countItems","className","total","otherProps"],"sources":["../../../../../../src/components/SelectComponents/SelectItemAll/SelectItemAll.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { ListItem } from '##/components/ListCanary';\nimport { Text, TextPropSize } from '##/components/Text';\nimport { cn } from '##/utils/bem';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nimport { Checkbox } from '../../Checkbox/Checkbox';\nimport { sizeCheckboxMap } from '../SelectItem/SelectItem';\nimport { PropSize } from '../types';\n\nexport type SelectItemAllProps = PropsWithHTMLAttributesAndRef<\n {\n checked: boolean;\n intermediate?: boolean;\n size: PropSize;\n hovered?: boolean;\n indent?: 'normal' | 'increased';\n countItems?: number;\n total?: number;\n },\n HTMLDivElement\n>;\n\nexport const cnSelectItemAll = cn('SelectItemAll');\n\nconst textSizeMap: Record<PropSize, TextPropSize> = {\n xs: 's',\n s: 's',\n m: 'm',\n l: 'l',\n};\n\nexport const SelectItemAll: React.FC<SelectItemAllProps> = forwardRef(\n (props, ref) => {\n const {\n checked,\n intermediate,\n size,\n indent,\n hovered,\n countItems = 0,\n className,\n total = 0,\n ...otherProps\n } = props;\n\n return (\n <ListItem\n {...otherProps}\n ref={ref}\n className={cnSelectItemAll(null, [className])}\n aria-selected={checked}\n role=\"option\"\n label=\"Выбрать все\"\n innerOffset={indent}\n size={size}\n active={hovered}\n rightSide={\n <Text\n size={textSizeMap[size]}\n lineHeight=\"xs\"\n view=\"ghost\"\n >{`${countItems} из ${total}`}</Text>\n }\n leftSide={\n <Checkbox\n checked={checked}\n intermediate={intermediate}\n size={sizeCheckboxMap[size]}\n />\n }\n >\n Выбрать все\n </ListItem>\n );\n },\n);\n"],"mappings":"yLAAA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,QAAT,wBACA,OAASC,IAAT,kBACA,OAASC,EAAT,0BAGA,OAASC,QAAT,+BACA,OAASC,eAAT,gCAgBA,MAAO,IAAMC,gBAAe,CAAGH,EAAE,CAAC,eAAD,CAA1B,CAEP,GAAMI,YAA2C,CAAG,CAClDC,EAAE,CAAE,GAD8C,CAElDC,CAAC,CAAE,GAF+C,CAGlDC,CAAC,CAAE,GAH+C,CAIlDC,CAAC,CAAE,GAJ+C,CAApD,CAOA,MAAO,IAAMC,cAA2C,CAAGZ,UAAU,CACnE,SAACa,CAAD,CAAQC,CAAR,CAAgB,CACd,GACEC,EADF,CAUIF,CAVJ,CACEE,OADF,CAEEC,CAFF,CAUIH,CAVJ,CAEEG,YAFF,CAGEC,CAHF,CAUIJ,CAVJ,CAGEI,IAHF,CAIEC,CAJF,CAUIL,CAVJ,CAIEK,MAJF,CAKEC,CALF,CAUIN,CAVJ,CAKEM,OALF,GAUIN,CAVJ,CAMEO,UANF,CAMEA,CANF,YAMe,CANf,GAOEC,CAPF,CAUIR,CAVJ,CAOEQ,SAPF,GAUIR,CAVJ,CAQES,KARF,CAQEA,CARF,YAQU,CARV,GASKC,CATL,0BAUIV,CAVJ,YAYA,MACE,qBAAC,QAAD,kBACMU,CADN,EAEE,GAAG,CAAET,CAFP,CAGE,SAAS,CAAER,eAAe,CAAC,IAAD,CAAO,CAACe,CAAD,CAAP,CAH5B,CAIE,gBAAeN,CAJjB,CAKE,IAAI,CAAC,QALP,CAME,KAAK,CAAC,+DANR,CAOE,WAAW,CAAEG,CAPf,CAQE,IAAI,CAAED,CARR,CASE,MAAM,CAAEE,CATV,CAUE,SAAS,CACP,oBAAC,IAAD,EACE,IAAI,CAAEZ,WAAW,CAACU,CAAD,CADnB,CAEE,UAAU,CAAC,IAFb,CAGE,IAAI,CAAC,OAHP,YAIKG,CAJL,0BAIsBE,CAJtB,EAXJ,CAiBE,QAAQ,CACN,oBAAC,QAAD,EACE,OAAO,CAAEP,CADX,CAEE,YAAY,CAAEC,CAFhB,CAGE,IAAI,CAAEX,eAAe,CAACY,CAAD,CAHvB,EAlBJ,mEA4BH,CA3CkE,CAA9D"}
@@ -1 +1 @@
1
- export * from './SelectSelectAll';
1
+ export * from './SelectItemAll';
@@ -1,2 +1,2 @@
1
- export*from"./SelectSelectAll";
1
+ export*from"./SelectItemAll";
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/components/SelectComponents/SelectItemAll/index.ts"],"sourcesContent":["export * from './SelectSelectAll';\n"],"mappings":"AAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/components/SelectComponents/SelectItemAll/index.ts"],"sourcesContent":["export * from './SelectItemAll';\n"],"mappings":"AAAA"}
@@ -1,2 +1,2 @@
1
- import"./SelectLoader.css";import React from"react";import{Loader}from"../../LoaderDeprecated";import{cnCanary}from"../../../utils/bem";export var cnSelectLoader=cnCanary("SelectLoader");export var SelectLoader=function(){return React.createElement("div",{className:cnSelectLoader()},React.createElement(Loader,{className:cnSelectLoader("Loader"),size:"s"}))};
1
+ import"./SelectLoader.css";import React from"react";import{Loader}from"../../LoaderDeprecated";import{cn}from"../../../utils/bem";export var cnSelectLoader=cn("SelectLoader");export var SelectLoader=function(){return React.createElement("div",{className:cnSelectLoader()},React.createElement(Loader,{className:cnSelectLoader("Loader"),size:"s"}))};
2
2
  //# sourceMappingURL=SelectLoader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectLoader.js","names":["React","Loader","cnCanary","cnSelectLoader","SelectLoader"],"sources":["../../../../../../src/components/SelectComponents/SelectLoader/SelectLoader.tsx"],"sourcesContent":["import './SelectLoader.css';\n\nimport React from 'react';\n\nimport { Loader } from '##/components/LoaderDeprecated';\nimport { cnCanary } from '##/utils/bem';\n\nexport const cnSelectLoader = cnCanary('SelectLoader');\n\nexport const SelectLoader = () => {\n return (\n <div className={cnSelectLoader()}>\n <Loader className={cnSelectLoader('Loader')} size=\"s\" />\n </div>\n );\n};\n"],"mappings":"AAAA,2BAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,MAAT,8BACA,OAASC,QAAT,0BAEA,MAAO,IAAMC,eAAc,CAAGD,QAAQ,CAAC,cAAD,CAA/B,CAEP,MAAO,IAAME,aAAY,CAAG,UAAM,CAChC,MACE,4BAAK,SAAS,CAAED,cAAc,EAA9B,EACE,oBAAC,MAAD,EAAQ,SAAS,CAAEA,cAAc,CAAC,QAAD,CAAjC,CAA6C,IAAI,CAAC,GAAlD,EADF,CAIH,CANM"}
1
+ {"version":3,"file":"SelectLoader.js","names":["React","Loader","cn","cnSelectLoader","SelectLoader"],"sources":["../../../../../../src/components/SelectComponents/SelectLoader/SelectLoader.tsx"],"sourcesContent":["import './SelectLoader.css';\n\nimport React from 'react';\n\nimport { Loader } from '##/components/LoaderDeprecated';\nimport { cn } from '##/utils/bem';\n\nexport const cnSelectLoader = cn('SelectLoader');\n\nexport const SelectLoader = () => {\n return (\n <div className={cnSelectLoader()}>\n <Loader className={cnSelectLoader('Loader')} size=\"s\" />\n </div>\n );\n};\n"],"mappings":"AAAA,2BAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,MAAT,8BACA,OAASC,EAAT,0BAEA,MAAO,IAAMC,eAAc,CAAGD,EAAE,CAAC,cAAD,CAAzB,CAEP,MAAO,IAAME,aAAY,CAAG,UAAM,CAChC,MACE,4BAAK,SAAS,CAAED,cAAc,EAA9B,EACE,oBAAC,MAAD,EAAQ,SAAS,CAAEA,cAAc,CAAC,QAAD,CAAjC,CAA6C,IAAI,CAAC,GAAlD,EADF,CAIH,CANM"}
@@ -1,2 +1,2 @@
1
- import"./SelectValueTag.css";import React from"react";import{Tag}from"../../Tag";import{cnCanary}from"../../../utils/bem";export var cnSelectValueTag=cnCanary("SelectValueTag");export var SelectValueTag=function(a){var b=a.handleRemove,c=void 0===b?function(){}:b,d=a.size,e=a.label,f=a.disabled;return React.createElement(Tag,{className:cnSelectValueTag({size:d,disabled:f}),label:e,mode:"cancel",onCancel:c,size:d})};
1
+ import"./SelectValueTag.css";import React from"react";import{Tag}from"../../Tag";import{cn}from"../../../utils/bem";export var cnSelectValueTag=cn("SelectValueTag");export var SelectValueTag=function(a){var b=a.handleRemove,c=void 0===b?function(){}:b,d=a.size,e=a.label,f=a.disabled;return React.createElement(Tag,{className:cnSelectValueTag({size:d,disabled:f}),label:e,mode:"cancel",onCancel:c,size:d})};
2
2
  //# sourceMappingURL=SelectValueTag.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectValueTag.js","names":["React","Tag","cnCanary","cnSelectValueTag","SelectValueTag","props","handleRemove","size","label","disabled"],"sources":["../../../../../../src/components/SelectComponents/SelectValueTag/SelectValueTag.tsx"],"sourcesContent":["import './SelectValueTag.css';\n\nimport React from 'react';\n\nimport { Tag } from '##/components/Tag';\nimport { cnCanary } from '##/utils/bem';\n\ntype SelectValueTagProps = {\n label: string;\n size: 's' | 'm' | 'l' | 'xs';\n children?: never;\n disabled?: boolean;\n handleRemove?: (e: React.SyntheticEvent) => void;\n};\n\nexport const cnSelectValueTag = cnCanary('SelectValueTag');\n\nexport const SelectValueTag: React.FC<SelectValueTagProps> = (props) => {\n const { handleRemove = () => {}, size, label, disabled } = props;\n\n return (\n <Tag\n className={cnSelectValueTag({ size, disabled })}\n label={label}\n mode=\"cancel\"\n onCancel={handleRemove}\n size={size}\n />\n );\n};\n"],"mappings":"AAAA,6BAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,GAAT,iBACA,OAASC,QAAT,0BAUA,MAAO,IAAMC,iBAAgB,CAAGD,QAAQ,CAAC,gBAAD,CAAjC,CAEP,MAAO,IAAME,eAA6C,CAAG,SAACC,CAAD,CAAW,CACtE,MAA2DA,CAA3D,CAAQC,YAAR,CAAQA,CAAR,YAAuB,UAAM,CAAE,CAA/B,GAAiCC,CAAjC,CAA2DF,CAA3D,CAAiCE,IAAjC,CAAuCC,CAAvC,CAA2DH,CAA3D,CAAuCG,KAAvC,CAA8CC,CAA9C,CAA2DJ,CAA3D,CAA8CI,QAA9C,CAEA,MACE,qBAAC,GAAD,EACE,SAAS,CAAEN,gBAAgB,CAAC,CAAEI,IAAI,CAAJA,CAAF,CAAQE,QAAQ,CAARA,CAAR,CAAD,CAD7B,CAEE,KAAK,CAAED,CAFT,CAGE,IAAI,CAAC,QAHP,CAIE,QAAQ,CAAEF,CAJZ,CAKE,IAAI,CAAEC,CALR,EAQH,CAZM"}
1
+ {"version":3,"file":"SelectValueTag.js","names":["React","Tag","cn","cnSelectValueTag","SelectValueTag","props","handleRemove","size","label","disabled"],"sources":["../../../../../../src/components/SelectComponents/SelectValueTag/SelectValueTag.tsx"],"sourcesContent":["import './SelectValueTag.css';\n\nimport React from 'react';\n\nimport { Tag } from '##/components/Tag';\nimport { cn } from '##/utils/bem';\n\ntype SelectValueTagProps = {\n label: string;\n size: 's' | 'm' | 'l' | 'xs';\n children?: never;\n disabled?: boolean;\n handleRemove?: (e: React.SyntheticEvent) => void;\n};\n\nexport const cnSelectValueTag = cn('SelectValueTag');\n\nexport const SelectValueTag: React.FC<SelectValueTagProps> = (props) => {\n const { handleRemove = () => {}, size, label, disabled } = props;\n\n return (\n <Tag\n className={cnSelectValueTag({ size, disabled })}\n label={label}\n mode=\"cancel\"\n onCancel={handleRemove}\n size={size}\n />\n );\n};\n"],"mappings":"AAAA,6BAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,GAAT,iBACA,OAASC,EAAT,0BAUA,MAAO,IAAMC,iBAAgB,CAAGD,EAAE,CAAC,gBAAD,CAA3B,CAEP,MAAO,IAAME,eAA6C,CAAG,SAACC,CAAD,CAAW,CACtE,MAA2DA,CAA3D,CAAQC,YAAR,CAAQA,CAAR,YAAuB,UAAM,CAAE,CAA/B,GAAiCC,CAAjC,CAA2DF,CAA3D,CAAiCE,IAAjC,CAAuCC,CAAvC,CAA2DH,CAA3D,CAAuCG,KAAvC,CAA8CC,CAA9C,CAA2DJ,CAA3D,CAA8CI,QAA9C,CAEA,MACE,qBAAC,GAAD,EACE,SAAS,CAAEN,gBAAgB,CAAC,CAAEI,IAAI,CAAJA,CAAF,CAAQE,QAAQ,CAARA,CAAR,CAAD,CAD7B,CAEE,KAAK,CAAED,CAFT,CAGE,IAAI,CAAC,QAHP,CAIE,QAAQ,CAAEF,CAJZ,CAKE,IAAI,CAAEC,CALR,EAQH,CAZM"}
@@ -1,2 +1,2 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","name","size","view","align","disabled","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputRef"];import"./Switch.css";import React,{useRef}from"react";import{useForkRef}from"../../hooks/useForkRef/useForkRef";import{cnMixFocus}from"../../mixs/MixFocus/MixFocus";import{cn}from"../../utils/bem";import{usePropsHandler}from"../EventInterceptor/usePropsHandler";import{switchPropAlignDefault,switchPropSizeDefault,switchPropViewDefault}from"./types";export var cnSwitch=cn("Switch");export var COMPONENT_NAME="Switch";export var Switch=React.forwardRef(function(a,b){var c=useRef(null),d=usePropsHandler(COMPONENT_NAME,a,c),e=d.checked,f=d.name,g=d.size,h=void 0===g?switchPropSizeDefault:g,i=d.view,j=void 0===i?switchPropViewDefault:i,k=d.align,l=void 0===k?switchPropAlignDefault:k,m=d.disabled,n=d.className,o=d.label,p=d.onChange,q=d.onFocus,r=d.onBlur,s=d.readOnly,t=d.required,u=d.step,v=d.tabIndex,w=d.inputRef,x=_objectWithoutProperties(d,_excluded);return React.createElement("label",Object.assign({},x,{className:cnSwitch({size:h,view:j,disabled:m,align:l},[n]),ref:useForkRef([c,b])}),React.createElement("input",{type:"checkbox",name:f,className:cnSwitch("Input",[cnMixFocus()]),checked:void 0!==e&&e,disabled:m,onChange:p,onFocus:q,onBlur:r,readOnly:s,required:t,step:u,tabIndex:v,ref:w}),o&&React.createElement("span",{className:cnSwitch("Label")},o))});
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","name","size","view","align","disabled","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputRef"];import"./Switch.css";import React,{useRef}from"react";import{useForkRef}from"../../hooks/useForkRef/useForkRef";import{cnMixFocus}from"../../mixs/MixFocus/MixFocus";import{cn}from"../../utils/bem";import{usePropsHandler}from"../EventInterceptor/usePropsHandler";import{switchPropAlignDefault,switchPropOnChangeDefault,switchPropSizeDefault,switchPropViewDefault}from"./types";export var cnSwitch=cn("Switch");export var COMPONENT_NAME="Switch";export var Switch=React.forwardRef(function(a,b){var c=useRef(null),d=usePropsHandler(COMPONENT_NAME,a,c),e=d.checked,f=d.name,g=d.size,h=void 0===g?switchPropSizeDefault:g,i=d.view,j=void 0===i?switchPropViewDefault:i,k=d.align,l=void 0===k?switchPropAlignDefault:k,m=d.disabled,n=d.className,o=d.label,p=d.onChange,q=void 0===p?switchPropOnChangeDefault:p,r=d.onFocus,s=d.onBlur,t=d.readOnly,u=d.required,v=d.step,w=d.tabIndex,x=d.inputRef,y=_objectWithoutProperties(d,_excluded);return React.createElement("label",Object.assign({},y,{className:cnSwitch({size:h,view:j,disabled:m,align:l},[n]),ref:useForkRef([c,b])}),React.createElement("input",{type:"checkbox",name:f,className:cnSwitch("Input",[cnMixFocus()]),checked:void 0!==e&&e,disabled:m,onChange:q,onFocus:r,onBlur:s,readOnly:t,required:u,step:v,tabIndex:w,ref:x}),o&&React.createElement("span",{className:cnSwitch("Label")},o))});
2
2
  //# sourceMappingURL=Switch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","names":["React","useRef","useForkRef","cnMixFocus","cn","usePropsHandler","switchPropAlignDefault","switchPropSizeDefault","switchPropViewDefault","cnSwitch","COMPONENT_NAME","Switch","forwardRef","props","ref","switchRef","checked","name","size","view","align","disabled","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputRef","otherProps"],"sources":["../../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import './Switch.css';\n\nimport React, { useRef } from 'react';\n\nimport { useForkRef } from '../../hooks/useForkRef/useForkRef';\nimport { cnMixFocus } from '../../mixs/MixFocus/MixFocus';\nimport { cn } from '../../utils/bem';\nimport { usePropsHandler } from '../EventInterceptor/usePropsHandler';\nimport {\n switchPropAlignDefault,\n SwitchProps,\n switchPropSizeDefault,\n switchPropViewDefault,\n} from './types';\n\nexport const cnSwitch = cn('Switch');\n\nexport const COMPONENT_NAME = 'Switch' as const;\n\nexport const Switch = React.forwardRef<HTMLLabelElement, SwitchProps>(\n (props, ref) => {\n const switchRef = useRef<HTMLLabelElement>(null);\n const {\n checked = false,\n name,\n size = switchPropSizeDefault,\n view = switchPropViewDefault,\n align = switchPropAlignDefault,\n disabled,\n className,\n label,\n onChange,\n onFocus,\n onBlur,\n readOnly,\n required,\n step,\n tabIndex,\n inputRef,\n ...otherProps\n } = usePropsHandler(COMPONENT_NAME, props, switchRef);\n\n return (\n <label\n {...otherProps}\n className={cnSwitch({ size, view, disabled, align }, [className])}\n ref={useForkRef([switchRef, ref])}\n >\n <input\n type=\"checkbox\"\n name={name}\n className={cnSwitch('Input', [cnMixFocus()])}\n checked={checked}\n disabled={disabled}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n readOnly={readOnly}\n required={required}\n step={step}\n tabIndex={tabIndex}\n ref={inputRef}\n />\n {label && <span className={cnSwitch('Label')}>{label}</span>}\n </label>\n );\n },\n);\n"],"mappings":"4PAAA,qBAEA,MAAOA,MAAP,EAAgBC,MAAhB,KAA8B,OAA9B,CAEA,OAASC,UAAT,yCACA,OAASC,UAAT,oCACA,OAASC,EAAT,uBACA,OA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OAAO,cAJT,CAKE,QAAQ,CAAEkB,CALZ,CAME,QAAQ,CAAEG,CANZ,CAOE,OAAO,CAAEC,CAPX,CAQE,MAAM,CAAEC,CARV,CASE,QAAQ,CAAEC,CATZ,CAUE,QAAQ,CAAEC,CAVZ,CAWE,IAAI,CAAEC,CAXR,CAYE,QAAQ,CAAEC,CAZZ,CAaE,GAAG,CAAEC,CAbP,EALF,CAoBGR,CAAK,EAAI,4BAAM,SAAS,CAAEd,QAAQ,CAAC,OAAD,CAAzB,EAAqCc,CAArC,CApBZ,CAuBH,CA/CmB,CAAf"}
1
+ {"version":3,"file":"Switch.js","names":["React","useRef","useForkRef","cnMixFocus","cn","usePropsHandler","switchPropAlignDefault","switchPropOnChangeDefault","switchPropSizeDefault","switchPropViewDefault","cnSwitch","COMPONENT_NAME","Switch","forwardRef","props","ref","switchRef","checked","name","size","view","align","disabled","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputRef","otherProps"],"sources":["../../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import './Switch.css';\n\nimport React, { useRef } from 'react';\n\nimport { useForkRef } from '../../hooks/useForkRef/useForkRef';\nimport { cnMixFocus } from '../../mixs/MixFocus/MixFocus';\nimport { cn } from '../../utils/bem';\nimport { usePropsHandler } from '../EventInterceptor/usePropsHandler';\nimport {\n switchPropAlignDefault,\n switchPropOnChangeDefault,\n SwitchProps,\n switchPropSizeDefault,\n switchPropViewDefault,\n} from './types';\n\nexport const cnSwitch = cn('Switch');\n\nexport const COMPONENT_NAME = 'Switch' as const;\n\nexport const Switch = React.forwardRef<HTMLLabelElement, SwitchProps>(\n (props, ref) => {\n const switchRef = useRef<HTMLLabelElement>(null);\n const {\n checked = false,\n name,\n size = switchPropSizeDefault,\n view = switchPropViewDefault,\n align = switchPropAlignDefault,\n disabled,\n className,\n label,\n onChange = switchPropOnChangeDefault,\n onFocus,\n onBlur,\n readOnly,\n required,\n step,\n tabIndex,\n inputRef,\n ...otherProps\n } = usePropsHandler(COMPONENT_NAME, props, switchRef);\n\n return (\n <label\n {...otherProps}\n className={cnSwitch({ size, view, disabled, align }, [className])}\n ref={useForkRef([switchRef, ref])}\n >\n <input\n type=\"checkbox\"\n name={name}\n className={cnSwitch('Input', [cnMixFocus()])}\n checked={checked}\n disabled={disabled}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n readOnly={readOnly}\n required={required}\n step={step}\n tabIndex={tabIndex}\n ref={inputRef}\n />\n {label && <span className={cnSwitch('Label')}>{label}</span>}\n </label>\n );\n },\n);\n"],"mappings":"4PAAA,qBAEA,MAAOA,MAAP,EAAgBC,MAAhB,KAA8B,OAA9B,CAEA,OAASC,UAAT,yCACA,OAASC,UAAT,oCACA,OAASC,EAAT,uBACA,OAASC,eAAT,2CACA,OACEC,sBADF,CAEEC,yBAFF,CAIEC,qBAJF,CAKEC,qBALF,eAQA,MAAO,IAAMC,SAAQ,CAAGN,EAAE,CAAC,QAAD,CAAnB,CAEP,MAAO,IAAMO,eAAc,CAAG,QAAvB,CAEP,MAAO,IAAMC,OAAM,CAAGZ,KAAK,CAACa,UAAN,CACpB,SAACC,CAAD,CAAQC,CAAR,CAAgB,IACRC,EAAS,CAAGf,MAAM,CAAmB,IAAnB,CADV,GAoBVI,eAAe,CAACM,cAAD,CAAiBG,CAAjB,CAAwBE,CAAxB,CApBL,KAGZC,OAHY,CAIZC,CAJY,GAIZA,IAJY,KAKZC,IALY,CAKZA,CALY,YAKLX,qBALK,OAMZY,IANY,CAMZA,CANY,YAMLX,qBANK,OAOZY,KAPY,CAOZA,CAPY,YAOJf,sBAPI,GAQZgB,CARY,GAQZA,QARY,CASZC,CATY,GASZA,SATY,CAUZC,CAVY,GAUZA,KAVY,KAWZC,QAXY,CAWZA,CAXY,YAWDlB,yBAXC,GAYZmB,CAZY,GAYZA,OAZY,CAaZC,CAbY,GAaZA,MAbY,CAcZC,CAdY,GAcZA,QAdY,CAeZC,CAfY,GAeZA,QAfY,CAgBZC,CAhBY,GAgBZA,IAhBY,CAiBZC,CAjBY,GAiBZA,QAjBY,CAkBZC,CAlBY,GAkBZA,QAlBY,CAmBTC,CAnBS,uCAsBd,MACE,8CACMA,CADN,EAEE,SAAS,CAAEvB,QAAQ,CAAC,CAAES,IAAI,CAAJA,CAAF,CAAQC,IAAI,CAAJA,CAAR,CAAcE,QAAQ,CAARA,CAAd,CAAwBD,KAAK,CAALA,CAAxB,CAAD,CAAkC,CAACE,CAAD,CAAlC,CAFrB,CAGE,GAAG,CAAErB,UAAU,CAAC,CAACc,CAAD,CAAYD,CAAZ,CAAD,CAHjB,GAKE,6BACE,IAAI,CAAC,UADP,CAEE,IAAI,CAAEG,CAFR,CAGE,SAAS,CAAER,QAAQ,CAAC,OAAD,CAAU,CAACP,UAAU,EAAX,CAAV,CAHrB,CAIE,OAAO,cAJT,CAKE,QAAQ,CAAEmB,CALZ,CAME,QAAQ,CAAEG,CANZ,CAOE,OAAO,CAAEC,CAPX,CAQE,MAAM,CAAEC,CARV,CASE,QAAQ,CAAEC,CATZ,CAUE,QAAQ,CAAEC,CAVZ,CAWE,IAAI,CAAEC,CAXR,CAYE,QAAQ,CAAEC,CAZZ,CAaE,GAAG,CAAEC,CAbP,EALF,CAoBGR,CAAK,EAAI,4BAAM,SAAS,CAAEd,QAAQ,CAAC,OAAD,CAAzB,EAAqCc,CAArC,CApBZ,CAuBH,CA/CmB,CAAf"}
@@ -9,6 +9,7 @@ export declare const switchPropViewDefault: SwitchPropView;
9
9
  export declare const switchPropAlign: readonly ["center", "top"];
10
10
  export declare type SwitchPropAlign = typeof switchPropAlign[number];
11
11
  export declare const switchPropAlignDefault: SwitchPropAlign;
12
+ export declare const switchPropOnChangeDefault: () => void;
12
13
  export declare type SwitchPropOnChange = (checked: boolean, params: {
13
14
  e: React.ChangeEvent<HTMLInputElement>;
14
15
  }) => void;
@@ -1,2 +1,2 @@
1
- export var switchPropSize=["m","xs","s","l"];export var switchPropSizeDefault=switchPropSize[0];export var switchPropView=["primary","ghost"];export var switchPropViewDefault=switchPropView[0];export var switchPropAlign=["center","top"];export var switchPropAlignDefault=switchPropAlign[0];
1
+ export var switchPropSize=["m","xs","s","l"];export var switchPropSizeDefault=switchPropSize[0];export var switchPropView=["primary","ghost"];export var switchPropViewDefault=switchPropView[0];export var switchPropAlign=["center","top"];export var switchPropAlignDefault=switchPropAlign[0];export var switchPropOnChangeDefault=function(){};
2
2
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["switchPropSize","switchPropSizeDefault","switchPropView","switchPropViewDefault","switchPropAlign","switchPropAlignDefault"],"sources":["../../../../../src/components/Switch/types.ts"],"sourcesContent":["import { PropsWithHTMLAttributes } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const switchPropSize = ['m', 'xs', 's', 'l'] as const;\nexport type SwitchPropSize = typeof switchPropSize[number];\nexport const switchPropSizeDefault: SwitchPropSize = switchPropSize[0];\n\nexport const switchPropView = ['primary', 'ghost'] as const;\nexport type SwitchPropView = typeof switchPropView[number];\nexport const switchPropViewDefault: SwitchPropView = switchPropView[0];\n\nexport const switchPropAlign = ['center', 'top'] as const;\nexport type SwitchPropAlign = typeof switchPropAlign[number];\nexport const switchPropAlignDefault: SwitchPropAlign = switchPropAlign[0];\n\nexport type SwitchPropOnChange = (\n checked: boolean,\n params: {\n e: React.ChangeEvent<HTMLInputElement>;\n },\n) => void;\n\nexport type SwitchProps = PropsWithHTMLAttributes<\n {\n checked: boolean | undefined;\n size?: SwitchPropSize;\n view?: SwitchPropView;\n align?: SwitchPropAlign;\n disabled?: boolean;\n className?: string;\n label?: string;\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\n name?: string;\n onFocus?: React.FocusEventHandler<HTMLInputElement>;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n autoFocus?: boolean;\n readOnly?: boolean;\n required?: boolean;\n step?: number | string;\n tabIndex?: number;\n inputRef?: React.Ref<HTMLInputElement>;\n children?: never;\n },\n HTMLLabelElement\n>;\n"],"mappings":"AAEA,MAAO,IAAMA,eAAc,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAAvB,CAEP,MAAO,IAAMC,sBAAqC,CAAGD,cAAc,CAAC,CAAD,CAA5D,CAEP,MAAO,IAAME,eAAc,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAvB,CAEP,MAAO,IAAMC,sBAAqC,CAAGD,cAAc,CAAC,CAAD,CAA5D,CAEP,MAAO,IAAME,gBAAe,CAAG,CAAC,QAAD,CAAW,KAAX,CAAxB,CAEP,MAAO,IAAMC,uBAAuC,CAAGD,eAAe,CAAC,CAAD,CAA/D"}
1
+ {"version":3,"file":"types.js","names":["switchPropSize","switchPropSizeDefault","switchPropView","switchPropViewDefault","switchPropAlign","switchPropAlignDefault","switchPropOnChangeDefault"],"sources":["../../../../../src/components/Switch/types.ts"],"sourcesContent":["import { PropsWithHTMLAttributes } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const switchPropSize = ['m', 'xs', 's', 'l'] as const;\nexport type SwitchPropSize = typeof switchPropSize[number];\nexport const switchPropSizeDefault: SwitchPropSize = switchPropSize[0];\n\nexport const switchPropView = ['primary', 'ghost'] as const;\nexport type SwitchPropView = typeof switchPropView[number];\nexport const switchPropViewDefault: SwitchPropView = switchPropView[0];\n\nexport const switchPropAlign = ['center', 'top'] as const;\nexport type SwitchPropAlign = typeof switchPropAlign[number];\nexport const switchPropAlignDefault: SwitchPropAlign = switchPropAlign[0];\n\nexport const switchPropOnChangeDefault = () => {};\n\nexport type SwitchPropOnChange = (\n checked: boolean,\n params: {\n e: React.ChangeEvent<HTMLInputElement>;\n },\n) => void;\n\nexport type SwitchProps = PropsWithHTMLAttributes<\n {\n checked: boolean | undefined;\n size?: SwitchPropSize;\n view?: SwitchPropView;\n align?: SwitchPropAlign;\n disabled?: boolean;\n className?: string;\n label?: string;\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\n name?: string;\n onFocus?: React.FocusEventHandler<HTMLInputElement>;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n autoFocus?: boolean;\n readOnly?: boolean;\n required?: boolean;\n step?: number | string;\n tabIndex?: number;\n inputRef?: React.Ref<HTMLInputElement>;\n children?: never;\n },\n HTMLLabelElement\n>;\n"],"mappings":"AAEA,MAAO,IAAMA,eAAc,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAAvB,CAEP,MAAO,IAAMC,sBAAqC,CAAGD,cAAc,CAAC,CAAD,CAA5D,CAEP,MAAO,IAAME,eAAc,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAvB,CAEP,MAAO,IAAMC,sBAAqC,CAAGD,cAAc,CAAC,CAAD,CAA5D,CAEP,MAAO,IAAME,gBAAe,CAAG,CAAC,QAAD,CAAW,KAAX,CAAxB,CAEP,MAAO,IAAMC,uBAAuC,CAAGD,eAAe,CAAC,CAAD,CAA/D,CAEP,MAAO,IAAME,0BAAyB,CAAG,UAAM,CAAE,CAA1C"}
@@ -1 +1 @@
1
- .canary--UserSelectItem{align-items:center;background-color:var(--color-control-bg-clear);color:var(--color-control-typo-default);cursor:pointer;display:flex;font-size:var(--font-size);position:relative}.canary--UserSelectItem_size_s{--font-size:var(--control-text-size-s);--sub-info-space:var(--space-xs);--sub-label-font-size:var(--size-text-2xs)}.canary--UserSelectItem_size_m{--font-size:var(--control-text-size-m);--sub-info-space:var(--space-s);--sub-label-font-size:var(--size-text-xs)}.canary--UserSelectItem_size_l{--font-size:var(--control-text-size-l);--sub-info-space:var(--space-s);--sub-label-font-size:var(--size-text-s)}.canary--UserSelectItem_disable{color:var(--color-control-typo-disable)}.canary--UserSelectItem_disable .UserSelectItem-AvatarContainer{opacity:.6}.canary--UserSelectItem_hovered{background-color:var(--color-control-bg-clear-hover)}.canary--UserSelectItem_active{color:var(--color-control-typo-secondary)}.canary--UserSelectItem_indent_increased{padding-left:calc(var(--horizontal-space)*2.6)}.canary--UserSelectItem-AvatarContainer{position:relative}.canary--UserSelectItem-CheckIcon{background-color:var(--color-control-bg-primary);border:1px solid var(--color-control-bg-default);border-radius:50%;bottom:calc(var(--space-2xs)*-1);color:var(--color-control-bg-default);height:var(--graphics-size-xs);padding:0;position:absolute;right:calc(var(--space-2xs)*-1);width:var(--graphics-size-xs)}.canary--UserSelectItem-CheckIcon_animate_entered,.canary--UserSelectItem-CheckIcon_animate_entering,.canary--UserSelectItem-CheckIcon_animate_exited,.canary--UserSelectItem-CheckIcon_animate_exiting{transition:.2s ease;transition-property:opacity,transform}.canary--UserSelectItem-CheckIcon_animate_entered,.canary--UserSelectItem-CheckIcon_animate_entering{opacity:1;transform:scale(1)}.canary--UserSelectItem-CheckIcon_animate_exiting{opacity:0;transform:scale(.25)}.canary--UserSelectItem-CheckIcon_animate_exited{opacity:0;transform:scale(0)}.canary--UserSelectItem-Info{padding-left:var(--sub-info-space)}.canary--UserSelectItem-SubLabel{font-size:var(--sub-label-font-size);opacity:.7}.canary--UserSelectItem-SubLabel_disable{opacity:1}
1
+ .UserSelectItem{align-items:center;background-color:var(--color-control-bg-clear);color:var(--color-control-typo-default);cursor:pointer;display:flex;font-size:var(--font-size);position:relative}.UserSelectItem_size_s{--font-size:var(--control-text-size-s);--sub-info-space:var(--space-xs);--sub-label-font-size:var(--size-text-2xs)}.UserSelectItem_size_m{--font-size:var(--control-text-size-m);--sub-info-space:var(--space-s);--sub-label-font-size:var(--size-text-xs)}.UserSelectItem_size_l{--font-size:var(--control-text-size-l);--sub-info-space:var(--space-s);--sub-label-font-size:var(--size-text-s)}.UserSelectItem_disable{color:var(--color-control-typo-disable)}.UserSelectItem_disable .UserSelectItem-AvatarContainer{opacity:.6}.UserSelectItem_hovered{background-color:var(--color-control-bg-clear-hover)}.UserSelectItem_active{color:var(--color-control-typo-secondary)}.UserSelectItem_indent_increased{padding-left:calc(var(--horizontal-space)*2.6)}.UserSelectItem-AvatarContainer{position:relative}.UserSelectItem-CheckIcon{background-color:var(--color-control-bg-primary);border:1px solid var(--color-control-bg-default);border-radius:50%;bottom:calc(var(--space-2xs)*-1);color:var(--color-control-bg-default);height:var(--graphics-size-xs);padding:0;position:absolute;right:calc(var(--space-2xs)*-1);width:var(--graphics-size-xs)}.UserSelectItem-CheckIcon_animate_entered,.UserSelectItem-CheckIcon_animate_entering,.UserSelectItem-CheckIcon_animate_exited,.UserSelectItem-CheckIcon_animate_exiting{transition:.2s ease;transition-property:opacity,transform}.UserSelectItem-CheckIcon_animate_entered,.UserSelectItem-CheckIcon_animate_entering{opacity:1;transform:scale(1)}.UserSelectItem-CheckIcon_animate_exiting{opacity:0;transform:scale(.25)}.UserSelectItem-CheckIcon_animate_exited{opacity:0;transform:scale(0)}.UserSelectItem-Info{padding-left:var(--sub-info-space)}.UserSelectItem-SubLabel{font-size:var(--sub-label-font-size);opacity:.7}.UserSelectItem-SubLabel_disable{opacity:1}
@@ -1,2 +1,2 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","label","subLabel","avatarUrl","active","hovered","size","indent","disable","multiple"];import"./UserSelectItem.css";import{IconCheck}from"@consta/icons/IconCheck";import React,{forwardRef,useRef}from"react";import{Transition}from"react-transition-group";import{Avatar}from"../../Avatar";import{mapHorisontalSpase,mapHorisontalSpaseIncreased,mapItemVerticalPadding}from"../../ListCanary";import{cnMixSpace}from"../../../mixs/MixSpace";import{cnCanary}from"../../../utils/bem";export var cnUserSelectItem=cnCanary("UserSelectItem");export var UserSelectItem=forwardRef(function(a,b){var c=a.className,d=a.label,e=a.subLabel,f=a.avatarUrl,g=a.active,h=a.hovered,i=a.size,j=a.indent,k=a.disable,l=a.multiple,m=_objectWithoutProperties(a,_excluded),n=useRef(null);return React.createElement("div",Object.assign({},m,{className:cnUserSelectItem({active:g,hovered:h,size:i,indent:j,disable:k},[cnMixSpace({pH:"increased"===j?mapHorisontalSpaseIncreased[i]:mapHorisontalSpase[i],pV:mapItemVerticalPadding[i]}),c]),"aria-selected":g,ref:b}),React.createElement("div",{className:cnUserSelectItem("AvatarContainer")},React.createElement(Avatar,{className:cnUserSelectItem("Avatar"),url:f,name:d}),l&&React.createElement(Transition,{in:g,unmountOnExit:!0,timeout:200,nodeRef:n},function(a){return React.createElement(IconCheck,{className:cnUserSelectItem("CheckIcon",{animate:a}),ref:n})}),!l&&g&&React.createElement(IconCheck,{className:cnUserSelectItem("CheckIcon")})),e?React.createElement("div",{className:cnUserSelectItem("Info")},React.createElement("div",null,d),React.createElement("div",{className:cnUserSelectItem("SubLabel",{disable:k})},e)):React.createElement("div",{className:cnUserSelectItem("Info")},d))});
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","label","subLabel","avatarUrl","active","hovered","size","indent","disable","multiple"];import"./UserSelectItem.css";import{IconCheck}from"@consta/icons/IconCheck";import React,{forwardRef,useRef}from"react";import{Transition}from"react-transition-group";import{Avatar}from"../../Avatar";import{mapHorisontalSpase,mapHorisontalSpaseIncreased,mapItemVerticalPadding}from"../../ListCanary";import{cnMixSpace}from"../../../mixs/MixSpace";import{cn}from"../../../utils/bem";export var cnUserSelectItem=cn("UserSelectItem");export var UserSelectItem=forwardRef(function(a,b){var c=a.className,d=a.label,e=a.subLabel,f=a.avatarUrl,g=a.active,h=a.hovered,i=a.size,j=a.indent,k=a.disable,l=a.multiple,m=_objectWithoutProperties(a,_excluded),n=useRef(null);return React.createElement("div",Object.assign({},m,{className:cnUserSelectItem({active:g,hovered:h,size:i,indent:j,disable:k},[cnMixSpace({pH:"increased"===j?mapHorisontalSpaseIncreased[i]:mapHorisontalSpase[i],pV:mapItemVerticalPadding[i]}),c]),"aria-selected":g,ref:b}),React.createElement("div",{className:cnUserSelectItem("AvatarContainer")},React.createElement(Avatar,{className:cnUserSelectItem("Avatar"),url:f,name:d}),l&&React.createElement(Transition,{in:g,unmountOnExit:!0,timeout:200,nodeRef:n},function(a){return React.createElement(IconCheck,{className:cnUserSelectItem("CheckIcon",{animate:a}),ref:n})}),!l&&g&&React.createElement(IconCheck,{className:cnUserSelectItem("CheckIcon")})),e?React.createElement("div",{className:cnUserSelectItem("Info")},React.createElement("div",null,d),React.createElement("div",{className:cnUserSelectItem("SubLabel",{disable:k})},e)):React.createElement("div",{className:cnUserSelectItem("Info")},d))});
2
2
  //# sourceMappingURL=UserSelectItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserSelectItem.js","names":["IconCheck","React","forwardRef","useRef","Transition","Avatar","mapHorisontalSpase","mapHorisontalSpaseIncreased","mapItemVerticalPadding","cnMixSpace","cnCanary","cnUserSelectItem","UserSelectItem","props","ref","className","label","subLabel","avatarUrl","active","hovered","size","indent","disable","multiple","otherProps","iconRef","pH","pV","animate"],"sources":["../../../../../../src/components/UserSelect/UserSelectItem/UserSelectItem.tsx"],"sourcesContent":["import './UserSelectItem.css';\n\nimport { IconCheck } from '@consta/icons/IconCheck';\nimport React, { forwardRef, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport { Avatar } from '##/components/Avatar';\nimport {\n mapHorisontalSpase,\n mapHorisontalSpaseIncreased,\n mapItemVerticalPadding,\n} from '##/components/ListCanary';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cnCanary } from '##/utils/bem';\nimport { PropsWithHTMLAttributes } from '##/utils/types/PropsWithHTMLAttributes';\n\ntype UserSelectItemProps = PropsWithHTMLAttributes<\n {\n label: string;\n active: boolean;\n hovered: boolean;\n size: 's' | 'm' | 'l';\n indent: 'normal' | 'increased';\n subLabel?: string;\n avatarUrl?: string;\n disable?: boolean;\n multiple?: boolean;\n },\n HTMLDivElement\n>;\n\nexport const cnUserSelectItem = cnCanary('UserSelectItem');\n\nexport const UserSelectItem = forwardRef<HTMLDivElement, UserSelectItemProps>(\n (props, ref) => {\n const {\n className,\n label,\n subLabel,\n avatarUrl,\n active,\n hovered,\n size,\n indent,\n disable,\n multiple,\n ...otherProps\n } = props;\n\n const iconRef = useRef<HTMLSpanElement>(null);\n\n return (\n <div\n {...otherProps}\n className={cnUserSelectItem(\n { active, hovered, size, indent, disable },\n [\n cnMixSpace({\n pH:\n indent === 'increased'\n ? mapHorisontalSpaseIncreased[size]\n : mapHorisontalSpase[size],\n pV: mapItemVerticalPadding[size],\n }),\n className,\n ],\n )}\n aria-selected={active}\n ref={ref}\n >\n <div className={cnUserSelectItem('AvatarContainer')}>\n <Avatar\n className={cnUserSelectItem('Avatar')}\n url={avatarUrl}\n name={label}\n />\n {multiple && (\n <Transition\n in={active}\n unmountOnExit\n timeout={200}\n nodeRef={iconRef}\n >\n {(animate) => (\n <IconCheck\n className={cnUserSelectItem('CheckIcon', { animate })}\n ref={iconRef}\n />\n )}\n </Transition>\n )}\n {!multiple && active && (\n <IconCheck className={cnUserSelectItem('CheckIcon')} />\n )}\n </div>\n {!subLabel ? (\n <div className={cnUserSelectItem('Info')}>{label}</div>\n ) : (\n <div className={cnUserSelectItem('Info')}>\n <div>{label}</div>\n <div className={cnUserSelectItem('SubLabel', { disable })}>\n {subLabel}\n </div>\n </div>\n )}\n </div>\n );\n },\n);\n"],"mappings":"wMAAA,6BAEA,OAASA,SAAT,KAA0B,yBAA1B,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,MAA5B,KAA0C,OAA1C,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAEA,OAASC,MAAT,oBACA,OACEC,kBADF,CAEEC,2BAFF,CAGEC,sBAHF,wBAKA,OAASC,UAAT,8BACA,OAASC,QAAT,0BAkBA,MAAO,IAAMC,iBAAgB,CAAGD,QAAQ,CAAC,gBAAD,CAAjC,CAEP,MAAO,IAAME,eAAc,CAAGV,UAAU,CACtC,SAACW,CAAD,CAAQC,CAAR,CAAgB,IAEZC,EAFY,CAaVF,CAbU,CAEZE,SAFY,CAGZC,CAHY,CAaVH,CAbU,CAGZG,KAHY,CAIZC,CAJY,CAaVJ,CAbU,CAIZI,QAJY,CAKZC,CALY,CAaVL,CAbU,CAKZK,SALY,CAMZC,CANY,CAaVN,CAbU,CAMZ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b,EACC,oBAAC,SAAD,EAAW,SAAS,CAAER,gBAAgB,CAAC,WAAD,CAAtC,EAtBJ,CAlBF,CA2CIM,CAAD,CAGC,2BAAK,SAAS,CAAEN,gBAAgB,CAAC,MAAD,CAAhC,EACE,+BAAMK,CAAN,CADF,CAEE,2BAAK,SAAS,CAAEL,gBAAgB,CAAC,UAAD,CAAa,CAAEY,OAAO,CAAPA,CAAF,CAAb,CAAhC,EACGN,CADH,CAFF,CAHD,CACC,2BAAK,SAAS,CAAEN,gBAAgB,CAAC,MAAD,CAAhC,EAA2CK,CAA3C,CA5CJ,CAuDH,CA1EqC,CAAjC"}
1
+ {"version":3,"file":"UserSelectItem.js","names":["IconCheck","React","forwardRef","useRef","Transition","Avatar","mapHorisontalSpase","mapHorisontalSpaseIncreased","mapItemVerticalPadding","cnMixSpace","cn","cnUserSelectItem","UserSelectItem","props","ref","className","label","subLabel","avatarUrl","active","hovered","size","indent","disable","multiple","otherProps","iconRef","pH","pV","animate"],"sources":["../../../../../../src/components/UserSelect/UserSelectItem/UserSelectItem.tsx"],"sourcesContent":["import './UserSelectItem.css';\n\nimport { IconCheck } from '@consta/icons/IconCheck';\nimport React, { forwardRef, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport { Avatar } from '##/components/Avatar';\nimport {\n mapHorisontalSpase,\n mapHorisontalSpaseIncreased,\n mapItemVerticalPadding,\n} from '##/components/ListCanary';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\nimport { PropsWithHTMLAttributes } from '##/utils/types/PropsWithHTMLAttributes';\n\ntype UserSelectItemProps = PropsWithHTMLAttributes<\n {\n label: string;\n active: boolean;\n hovered: boolean;\n size: 's' | 'm' | 'l';\n indent: 'normal' | 'increased';\n subLabel?: string;\n avatarUrl?: string;\n disable?: boolean;\n multiple?: boolean;\n },\n HTMLDivElement\n>;\n\nexport const cnUserSelectItem = cn('UserSelectItem');\n\nexport const UserSelectItem = forwardRef<HTMLDivElement, UserSelectItemProps>(\n (props, ref) => {\n const {\n className,\n label,\n subLabel,\n avatarUrl,\n active,\n hovered,\n size,\n indent,\n disable,\n multiple,\n ...otherProps\n } = props;\n\n const iconRef = useRef<HTMLSpanElement>(null);\n\n return (\n <div\n {...otherProps}\n className={cnUserSelectItem(\n { active, hovered, size, indent, disable },\n [\n cnMixSpace({\n pH:\n indent === 'increased'\n ? mapHorisontalSpaseIncreased[size]\n : mapHorisontalSpase[size],\n pV: mapItemVerticalPadding[size],\n }),\n className,\n ],\n )}\n aria-selected={active}\n ref={ref}\n >\n <div className={cnUserSelectItem('AvatarContainer')}>\n <Avatar\n className={cnUserSelectItem('Avatar')}\n url={avatarUrl}\n name={label}\n />\n {multiple && (\n <Transition\n in={active}\n unmountOnExit\n timeout={200}\n nodeRef={iconRef}\n >\n {(animate) => (\n <IconCheck\n className={cnUserSelectItem('CheckIcon', { animate })}\n ref={iconRef}\n />\n )}\n </Transition>\n )}\n {!multiple && active && (\n <IconCheck className={cnUserSelectItem('CheckIcon')} />\n )}\n </div>\n {!subLabel ? (\n <div className={cnUserSelectItem('Info')}>{label}</div>\n ) : (\n <div className={cnUserSelectItem('Info')}>\n <div>{label}</div>\n <div className={cnUserSelectItem('SubLabel', { disable })}>\n {subLabel}\n </div>\n </div>\n )}\n </div>\n );\n },\n);\n"],"mappings":"wMAAA,6BAEA,OAASA,SAAT,KAA0B,yBAA1B,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,MAA5B,KAA0C,OAA1C,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAEA,OAASC,MAAT,oBACA,OACEC,kBADF,CAEEC,2BAFF,CAGEC,sBAHF,wBAKA,OAASC,UAAT,8BACA,OAASC,EAAT,0BAkBA,MAAO,IAAMC,iBAAgB,CAAGD,EAAE,CAAC,gBAAD,CAA3B,CAEP,MAAO,IAAME,eAAc,CAAGV,UAAU,CACtC,SAACW,CAAD,CAAQC,CAAR,CAAgB,IAEZC,EAFY,CAaVF,CAbU,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AD,EACE,SAAS,CAAElB,gBAAgB,CAAC,WAAD,CAAc,CAAEkB,OAAO,CAAPA,CAAF,CAAd,CAD7B,CAEE,GAAG,CAAEH,CAFP,EADD,CANH,CAPJ,CAqBG,CAACF,CAAD,EAAaL,CAAb,EACC,oBAAC,SAAD,EAAW,SAAS,CAAER,gBAAgB,CAAC,WAAD,CAAtC,EAtBJ,CAlBF,CA2CIM,CAAD,CAGC,2BAAK,SAAS,CAAEN,gBAAgB,CAAC,MAAD,CAAhC,EACE,+BAAMK,CAAN,CADF,CAEE,2BAAK,SAAS,CAAEL,gBAAgB,CAAC,UAAD,CAAa,CAAEY,OAAO,CAAPA,CAAF,CAAb,CAAhC,EACGN,CADH,CAFF,CAHD,CACC,2BAAK,SAAS,CAAEN,gBAAgB,CAAC,MAAD,CAAhC,EAA2CK,CAA3C,CA5CJ,CAuDH,CA1EqC,CAAjC"}
@@ -1 +1 @@
1
- .canary--UserSelectValue_multiple{margin-bottom:calc(var(--space-s)/4);margin-right:var(--space-xs)}.canary--UserSelectValue_disabled{opacity:.6}.canary--UserSelectValue:not(.canary--UserSelectValue_multiple).User:hover{background-color:var(--color-control-bg-clear)}
1
+ .UserSelectValue_multiple{margin-bottom:calc(var(--space-s)/4);margin-right:var(--space-xs)}.UserSelectValue_disabled{opacity:.6}.UserSelectValue:not(.UserSelectValue_multiple).User:hover{background-color:var(--color-control-bg-clear)}
@@ -1,2 +1,2 @@
1
- import"./UserSelectValue.css";import{IconClose}from"@consta/icons/IconClose";import React from"react";import{cnCanary}from"../../../utils/bem";import{User}from"../../User/User";export var cnUserSelectValue=cnCanary("UserSelectValue");export var UserSelectValue=function(a){var b=a.size,c=a.label,d=a.subLabel,e=a.disabled,f=a.handleRemove,g=a.avatarUrl,h=a.multiple;return React.createElement(User,{className:cnUserSelectValue({multiple:h,size:b,disabled:e}),avatarUrl:g,name:c,info:d,size:b,view:h?"ghost":"clear",iconRight:!e&&h?IconClose:void 0,onIconRightClick:!e&&h?f:void 0})};
1
+ import"./UserSelectValue.css";import{IconClose}from"@consta/icons/IconClose";import React from"react";import{cn}from"../../../utils/bem";import{User}from"../../User/User";export var cnUserSelectValue=cn("UserSelectValue");export var UserSelectValue=function(a){var b=a.size,c=a.label,d=a.subLabel,e=a.disabled,f=a.handleRemove,g=a.avatarUrl,h=a.multiple;return React.createElement(User,{className:cnUserSelectValue({multiple:h,size:b,disabled:e}),avatarUrl:g,name:c,info:d,size:b,view:h?"ghost":"clear",iconRight:!e&&h?IconClose:void 0,onIconRightClick:!e&&h?f:void 0})};
2
2
  //# sourceMappingURL=UserSelectValue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserSelectValue.js","names":["IconClose","React","cnCanary","User","cnUserSelectValue","UserSelectValue","props","size","label","subLabel","disabled","handleRemove","avatarUrl","multiple"],"sources":["../../../../../../src/components/UserSelect/UserSelectValue/UserSelectValue.tsx"],"sourcesContent":["import './UserSelectValue.css';\n\nimport { IconClose } from '@consta/icons/IconClose';\nimport React from 'react';\n\nimport { cnCanary } from '../../../utils/bem';\nimport { User } from '../../User/User';\n\ntype UserValueProps = {\n label: string;\n size: 's' | 'm' | 'l';\n subLabel?: string;\n avatarUrl?: string;\n handleRemove?: (e: React.SyntheticEvent) => void;\n multiple?: boolean;\n disabled?: boolean;\n children?: never;\n};\n\nexport const cnUserSelectValue = cnCanary('UserSelectValue');\n\nexport const UserSelectValue: React.FC<UserValueProps> = (props) => {\n const { size, label, subLabel, disabled, handleRemove, avatarUrl, multiple } =\n props;\n\n return (\n <User\n className={cnUserSelectValue({ multiple, size, disabled })}\n avatarUrl={avatarUrl}\n name={label}\n info={subLabel}\n size={size}\n view={multiple ? 'ghost' : 'clear'}\n iconRight={!disabled && multiple ? IconClose : undefined}\n onIconRightClick={!disabled && multiple ? handleRemove : undefined}\n />\n );\n};\n"],"mappings":"AAAA,8BAEA,OAASA,SAAT,KAA0B,yBAA1B,CACA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,QAAT,0BACA,OAASC,IAAT,uBAaA,MAAO,IAAMC,kBAAiB,CAAGF,QAAQ,CAAC,iBAAD,CAAlC,CAEP,MAAO,IAAMG,gBAAyC,CAAG,SAACC,CAAD,CAAW,CAClE,GAAQC,EAAR,CACED,CADF,CAAQC,IAAR,CAAcC,CAAd,CACEF,CADF,CAAcE,KAAd,CAAqBC,CAArB,CACEH,CADF,CAAqBG,QAArB,CAA+BC,CAA/B,CACEJ,CADF,CAA+BI,QAA/B,CAAyCC,CAAzC,CACEL,CADF,CAAyCK,YAAzC,CAAuDC,CAAvD,CACEN,CADF,CAAuDM,SAAvD,CAAkEC,CAAlE,CACEP,CADF,CAAkEO,QAAlE,CAGA,MACE,qBAAC,IAAD,EACE,SAAS,CAAET,iBAAiB,CAAC,CAAES,QAAQ,CAARA,CAAF,CAAYN,IAAI,CAAJA,CAAZ,CAAkBG,QAAQ,CAARA,CAAlB,CAAD,CAD9B,CAEE,SAAS,CAAEE,CAFb,CAGE,IAAI,CAAEJ,CAHR,CAIE,IAAI,CAAEC,CAJR,CAKE,IAAI,CAAEF,CALR,CAME,IAAI,CAAEM,CAAQ,CAAG,OAAH,CAAa,OAN7B,CAOE,SAAS,CAAE,CAACH,CAAD,EAAaG,CAAb,CAAwBb,SAAxB,OAPb,CAQE,gBAAgB,CAAE,CAACU,CAAD,EAAaG,CAAb,CAAwBF,CAAxB,OARpB,EAWH,CAhBM"}
1
+ {"version":3,"file":"UserSelectValue.js","names":["IconClose","React","cn","User","cnUserSelectValue","UserSelectValue","props","size","label","subLabel","disabled","handleRemove","avatarUrl","multiple"],"sources":["../../../../../../src/components/UserSelect/UserSelectValue/UserSelectValue.tsx"],"sourcesContent":["import './UserSelectValue.css';\n\nimport { IconClose } from '@consta/icons/IconClose';\nimport React from 'react';\n\nimport { cn } from '../../../utils/bem';\nimport { User } from '../../User/User';\n\ntype UserValueProps = {\n label: string;\n size: 's' | 'm' | 'l';\n subLabel?: string;\n avatarUrl?: string;\n handleRemove?: (e: React.SyntheticEvent) => void;\n multiple?: boolean;\n disabled?: boolean;\n children?: never;\n};\n\nexport const cnUserSelectValue = cn('UserSelectValue');\n\nexport const UserSelectValue: React.FC<UserValueProps> = (props) => {\n const { size, label, subLabel, disabled, handleRemove, avatarUrl, multiple } =\n props;\n\n return (\n <User\n className={cnUserSelectValue({ multiple, size, disabled })}\n avatarUrl={avatarUrl}\n name={label}\n info={subLabel}\n size={size}\n view={multiple ? 'ghost' : 'clear'}\n iconRight={!disabled && multiple ? IconClose : undefined}\n onIconRightClick={!disabled && multiple ? handleRemove : undefined}\n />\n );\n};\n"],"mappings":"AAAA,8BAEA,OAASA,SAAT,KAA0B,yBAA1B,CACA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,0BACA,OAASC,IAAT,uBAaA,MAAO,IAAMC,kBAAiB,CAAGF,EAAE,CAAC,iBAAD,CAA5B,CAEP,MAAO,IAAMG,gBAAyC,CAAG,SAACC,CAAD,CAAW,CAClE,GAAQC,EAAR,CACED,CADF,CAAQC,IAAR,CAAcC,CAAd,CACEF,CADF,CAAcE,KAAd,CAAqBC,CAArB,CACEH,CADF,CAAqBG,QAArB,CAA+BC,CAA/B,CACEJ,CADF,CAA+BI,QAA/B,CAAyCC,CAAzC,CACEL,CADF,CAAyCK,YAAzC,CAAuDC,CAAvD,CACEN,CADF,CAAuDM,SAAvD,CAAkEC,CAAlE,CACEP,CADF,CAAkEO,QAAlE,CAGA,MACE,qBAAC,IAAD,EACE,SAAS,CAAET,iBAAiB,CAAC,CAAES,QAAQ,CAARA,CAAF,CAAYN,IAAI,CAAJA,CAAZ,CAAkBG,QAAQ,CAARA,CAAlB,CAAD,CAD9B,CAEE,SAAS,CAAEE,CAFb,CAGE,IAAI,CAAEJ,CAHR,CAIE,IAAI,CAAEC,CAJR,CAKE,IAAI,CAAEF,CALR,CAME,IAAI,CAAEM,CAAQ,CAAG,OAAH,CAAa,OAN7B,CAOE,SAAS,CAAE,CAACH,CAAD,EAAaG,CAAb,CAAwBb,SAAxB,OAPb,CAQE,gBAAgB,CAAE,CAACU,CAAD,EAAaG,CAAb,CAAwBF,CAAxB,OARpB,EAWH,CAhBM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit",
3
- "version": "5.0.0",
3
+ "version": "5.0.2",
4
4
  "keywords": [
5
5
  "ui-kit",
6
6
  "design-system",
@@ -22,8 +22,8 @@
22
22
  "react": ">= 16.8.0",
23
23
  "react-dom": ">= 16.8.0",
24
24
  "react-dropzone": "11.3.4",
25
- "react-textarea-autosize": "^8.5.3",
26
25
  "react-imask": "^7.2.1",
26
+ "react-textarea-autosize": "^8.5.3",
27
27
  "react-transition-group": "^4.4.5"
28
28
  },
29
29
  "files": [
@@ -1,2 +0,0 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","intermediate","size","indent","hovered","countItems","className","total"];import React,{forwardRef}from"react";import{ListItem}from"../../ListCanary";import{Text}from"../../Text";import{cnCanary}from"../../../utils/bem";import{Checkbox}from"../../Checkbox/Checkbox";import{sizeCheckboxMap}from"../SelectItem/SelectItem";export var cnSelectItemAll=cnCanary("SelectItemAll");var textSizeMap={xs:"s",s:"s",m:"m",l:"l"};export var SelectItemAll=forwardRef(function(a,b){var c=a.checked,d=a.intermediate,e=a.size,f=a.indent,g=a.hovered,h=a.countItems,i=void 0===h?0:h,j=a.className,k=a.total,l=void 0===k?0:k,m=_objectWithoutProperties(a,_excluded);return React.createElement(ListItem,Object.assign({},m,{ref:b,className:cnSelectItemAll(null,[j]),"aria-selected":c,role:"option",label:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435",innerOffset:f,size:e,active:g,rightSide:React.createElement(Text,{size:textSizeMap[e],lineHeight:"xs",view:"ghost"},"".concat(i," \u0438\u0437 ").concat(l)),leftSide:React.createElement(Checkbox,{checked:c,intermediate:d,size:sizeCheckboxMap[e]})}),"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435")});
2
- //# sourceMappingURL=SelectSelectAll.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectSelectAll.js","names":["React","forwardRef","ListItem","Text","cnCanary","Checkbox","sizeCheckboxMap","cnSelectItemAll","textSizeMap","xs","s","m","l","SelectItemAll","props","ref","checked","intermediate","size","indent","hovered","countItems","className","total","otherProps"],"sources":["../../../../../../src/components/SelectComponents/SelectItemAll/SelectSelectAll.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { ListItem } from '##/components/ListCanary';\nimport { Text, TextPropSize } from '##/components/Text';\nimport { cnCanary } from '##/utils/bem';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nimport { Checkbox } from '../../Checkbox/Checkbox';\nimport { sizeCheckboxMap } from '../SelectItem/SelectItem';\nimport { PropSize } from '../types';\n\nexport type SelectItemAllProps = PropsWithHTMLAttributesAndRef<\n {\n checked: boolean;\n intermediate?: boolean;\n size: PropSize;\n hovered?: boolean;\n indent?: 'normal' | 'increased';\n countItems?: number;\n total?: number;\n },\n HTMLDivElement\n>;\n\nexport const cnSelectItemAll = cnCanary('SelectItemAll');\n\nconst textSizeMap: Record<PropSize, TextPropSize> = {\n xs: 's',\n s: 's',\n m: 'm',\n l: 'l',\n};\n\nexport const SelectItemAll: React.FC<SelectItemAllProps> = forwardRef(\n (props, ref) => {\n const {\n checked,\n intermediate,\n size,\n indent,\n hovered,\n countItems = 0,\n className,\n total = 0,\n ...otherProps\n } = props;\n\n return (\n <ListItem\n {...otherProps}\n ref={ref}\n className={cnSelectItemAll(null, [className])}\n aria-selected={checked}\n role=\"option\"\n label=\"Выбрать все\"\n innerOffset={indent}\n size={size}\n active={hovered}\n rightSide={\n <Text\n size={textSizeMap[size]}\n lineHeight=\"xs\"\n view=\"ghost\"\n >{`${countItems} из ${total}`}</Text>\n }\n leftSide={\n <Checkbox\n checked={checked}\n intermediate={intermediate}\n size={sizeCheckbox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