@consta/uikit 5.29.1 → 5.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__internal__/src/components/TextAreaAutoSize/TextAreaAutoSize.js +1 -1
- package/__internal__/src/components/TextAreaAutoSize/TextAreaAutoSize.js.map +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldCanary.js +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldCanary.js.map +1 -1
- package/__internal__/src/components/UserSelect/UserSelectItem/UserSelectItem.css +1 -1
- package/__internal__/src/components/UserSelect/UserSelectItem/UserSelectItem.d.ts +2 -1
- package/__internal__/src/components/UserSelect/UserSelectItem/UserSelectItem.js +1 -1
- package/__internal__/src/components/UserSelect/UserSelectItem/UserSelectItem.js.map +1 -1
- package/__internal__/src/components/UserSelect/UserSelectValue/UserSelectValue.css +1 -1
- package/__internal__/src/components/UserSelect/UserSelectValue/UserSelectValue.d.ts +2 -1
- package/__internal__/src/components/UserSelect/UserSelectValue/UserSelectValue.js.map +1 -1
- package/__internal__/src/components/UserSelect/helpers.d.ts +5 -4
- package/__internal__/src/components/UserSelect/helpers.js +1 -1
- package/__internal__/src/components/UserSelect/helpers.js.map +1 -1
- package/__internal__/src/hooks/useBodyScrollFreeze/index.d.ts +1 -0
- package/__internal__/src/hooks/useBodyScrollFreeze/index.js +2 -0
- package/__internal__/src/hooks/useBodyScrollFreeze/index.js.map +1 -0
- package/__internal__/src/hooks/useBodyScrollFreeze/useBodyScrollFreeze.css +1 -0
- package/__internal__/src/hooks/useBodyScrollFreeze/useBodyScrollFreeze.d.ts +6 -0
- package/__internal__/src/hooks/useBodyScrollFreeze/useBodyScrollFreeze.js +2 -0
- package/__internal__/src/hooks/useBodyScrollFreeze/useBodyScrollFreeze.js.map +1 -0
- package/__internal__/src/hooks/useHover/index.d.ts +1 -0
- package/__internal__/src/hooks/useHover/index.js +2 -0
- package/__internal__/src/hooks/useHover/index.js.map +1 -0
- package/__internal__/src/hooks/useHover/useHover.d.ts +9 -0
- package/__internal__/src/hooks/useHover/useHover.js +2 -0
- package/__internal__/src/hooks/useHover/useHover.js.map +1 -0
- package/__internal__/src/utils/object/clearUndefined.d.ts +1 -0
- package/__internal__/src/utils/object/clearUndefined.js +2 -0
- package/__internal__/src/utils/object/clearUndefined.js.map +1 -0
- package/__internal__/src/utils/object/index.d.ts +1 -0
- package/__internal__/src/utils/object/index.js +1 -1
- package/__internal__/src/utils/object/index.js.map +1 -1
- package/package.json +1 -1
- package/useBodyScrollFreeze/index.d.ts +1 -0
- package/useBodyScrollFreeze/index.js +1 -0
- package/useHover/index.d.ts +1 -0
- package/useHover/index.js +1 -0
|
@@ -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=["minRows","maxRows","onChange","style","className"];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"./TextAreaAutoSize.css";import{useAction,useAtom,useUpdate}from"@reatom/npm-react";import React,{forwardRef}from"react";import{createPortal}from"react-dom";import{useForkRef}from"../../hooks/useForkRef";import{cn}from"../../utils/bem";import{deepEqual}from"../../utils/objectCompare";import{useCreateAtom,useRefAtom,useResizeObservedAtom,useSendToAtom,withCtx}from"../../utils/state";export var cnTextAreaAutoSize=cn("TextAreaAutoSize");export var TextAreaAutoSize=withCtx(forwardRef(function(a,b){var c=a.minRows,d=void 0===c?1:c,e=a.maxRows,f=a.onChange,g=a.style,h=a.className,i=_objectWithoutProperties(a,_excluded),j=useRefAtom(),k=_slicedToArray(j,2),l=k[0],m=k[1],n=useRefAtom(),o=_slicedToArray(n,2),p=o[0],q=o[1],r=useAtom({}),s=_slicedToArray(r,3),t=s[0],u=s[2],v=useAtom({}),w=_slicedToArray(v,3),x=w[0],y=w[2],z=useSendToAtom(a),A=useAction(function(a){var b=a.get(l),c=a.get(p);if(b&&c){var f=getComputedStyle(b),g={minHeight:f.minHeight,maxHeight:f.maxHeight,width:f.width,
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["minRows","maxRows","onChange","style","className"];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"./TextAreaAutoSize.css";import{useAction,useAtom,useUpdate}from"@reatom/npm-react";import React,{forwardRef}from"react";import{createPortal}from"react-dom";import{useForkRef}from"../../hooks/useForkRef";import{cn}from"../../utils/bem";import{deepEqual}from"../../utils/objectCompare";import{useCreateAtom,useRefAtom,useResizeObservedAtom,useSendToAtom,withCtx}from"../../utils/state";export var cnTextAreaAutoSize=cn("TextAreaAutoSize");export var TextAreaAutoSize=withCtx(forwardRef(function(a,b){var c=a.minRows,d=void 0===c?1:c,e=a.maxRows,f=a.onChange,g=a.style,h=a.className,i=_objectWithoutProperties(a,_excluded),j=useRefAtom(),k=_slicedToArray(j,2),l=k[0],m=k[1],n=useRefAtom(),o=_slicedToArray(n,2),p=o[0],q=o[1],r=useAtom({}),s=_slicedToArray(r,3),t=s[0],u=s[2],v=useAtom({}),w=_slicedToArray(v,3),x=w[0],y=w[2],z=useSendToAtom(a),A=useAction(function(a){var b=a.get(l),c=a.get(p);if(b&&c){var f=getComputedStyle(b),g={minHeight:f.minHeight,maxHeight:f.maxHeight,width:f.width,paddingBottom:f.paddingBottom,paddingTop:f.paddingTop,paddingLeft:f.paddingLeft,paddingRight:f.paddingRight,margin:f.margin,border:f.border,borderTop:f.borderTop,borderBottom:f.borderBottom,borderLeft:f.borderLeft,borderRight:f.borderRight,fontFamily:f.fontFamily,fontSize:f.fontSize,lineHeight:f.lineHeight,tabSize:f.tabSize,textIndent:f.textIndent,textRendering:f.textRendering,textTransform:f.textTransform,display:f.display,whiteSpace:f.whiteSpace,wordBreak:f.wordBreak};deepEqual(g,a.get(y))||y(a,g);var h=getComputedStyle(c),i=parseFloat(h.lineHeight),j=parseFloat(h.paddingTop),k=parseFloat(h.paddingBottom),m=parseFloat(h.borderTopWidth),n=parseFloat(h.borderBottomWidth),o=j+k+m+n,q=c.scrollHeight,r=e?e*i+o:1/0,s=Math.min(Math.max(q,d*i+o),r);if(!isNaN(s)){var t={height:"".concat(s,"px"),overflowY:e&&q>r?"scroll":"hidden"};deepEqual(t,a.get(u))||u(a,t)}}}),B=useAction(function(a,b){var c,d;null===(c=(d=a.get(z)).onChange)||void 0===c?void 0:c.call(d,b);var e=a.get(p);e&&(e.value=b.target.value),A()});return useUpdate(A,[d,e,p,l]),useResizeObservedAtom(useCreateAtom(function(a){return[a.spy(l),a.get(p)]}),A),useCreateAtom(function(a){var b=a.spy(p),c=a.spy(l);b&&c&&(b.value=c.value,A())}),React.createElement(React.Fragment,null,React.createElement("textarea",Object.assign({},i,{ref:useForkRef([m,b]),onChange:B,style:_objectSpread(_objectSpread({},g),t),className:cnTextAreaAutoSize(null,[h])})),createPortal(React.createElement("textarea",{ref:q,style:x,className:cnTextAreaAutoSize("Fake"),id:cnTextAreaAutoSize("Fake",{id:i.id,name:i.name})}),document.body))}));
|
|
2
2
|
//# sourceMappingURL=TextAreaAutoSize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextAreaAutoSize.js","names":["useAction","useAtom","useUpdate","React","forwardRef","createPortal","useForkRef","cn","deepEqual","useCreateAtom","useRefAtom","useResizeObservedAtom","useSendToAtom","withCtx","cnTextAreaAutoSize","TextAreaAutoSize","props","ref","minRows","maxRows","onChange","style","className","restProps","textAreaElementAtom","textAreaRef","fakeElementAtom","fakeRef","textareaStyles","textareaStylesAtom","fakeStyles","fakeStylesAtom","propsAtom","calculateHeight","ctx","textAreaElement","get","fakeElement","textAreaStyles","getComputedStyle","newFakeStyles","minHeight","maxHeight","width","padding","paddingBottom","paddingTop","paddingLeft","paddingRight","margin","border","borderTop","borderBottom","borderLeft","borderRight","fontFamily","fontSize","lineHeight","tabSize","textIndent","textRendering","textTransform","display","whiteSpace","wordBreak","computedStyle","parseFloat","borderTopWidth","borderBottomWidth","gap","newHeight","scrollHeight","finalHeight","Math","min","max","isNaN","newTextareaStyles","height","overflowY","handleChange","e","value","target","spy","id","name","document","body"],"sources":["../../../../../src/components/TextAreaAutoSize/TextAreaAutoSize.tsx"],"sourcesContent":["import './TextAreaAutoSize.css';\n\nimport { useAction, useAtom, useUpdate } from '@reatom/npm-react';\nimport React, { forwardRef } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { cn } from '##/utils/bem';\nimport { deepEqual } from '##/utils/objectCompare';\nimport {\n useCreateAtom,\n useRefAtom,\n useResizeObservedAtom,\n useSendToAtom,\n withCtx,\n} from '##/utils/state';\n\nexport const cnTextAreaAutoSize = cn('TextAreaAutoSize');\n\nexport type TextAreaAutoSizeProps = {\n minRows?: number;\n maxRows?: number;\n} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nexport const TextAreaAutoSize = withCtx(\n forwardRef<HTMLTextAreaElement, TextAreaAutoSizeProps>((props, ref) => {\n const {\n minRows = 1,\n maxRows,\n onChange,\n style,\n className,\n ...restProps\n } = props;\n\n const [textAreaElementAtom, textAreaRef] =\n useRefAtom<HTMLTextAreaElement>();\n const [fakeElementAtom, fakeRef] = useRefAtom<HTMLTextAreaElement>();\n\n const [textareaStyles, , textareaStylesAtom] = useAtom<React.CSSProperties>(\n {},\n );\n const [fakeStyles, , fakeStylesAtom] = useAtom<React.CSSProperties>({});\n\n const propsAtom = useSendToAtom(props);\n\n const calculateHeight = useAction((ctx) => {\n const textAreaElement = ctx.get(textAreaElementAtom);\n const fakeElement = ctx.get(fakeElementAtom);\n\n if (!textAreaElement || !fakeElement) return;\n const textAreaStyles = getComputedStyle(textAreaElement);\n\n const newFakeStyles = {\n minHeight: textAreaStyles.minHeight,\n maxHeight: textAreaStyles.maxHeight,\n width: textAreaStyles.width,\n padding: textAreaStyles.padding,\n paddingBottom: textAreaStyles.paddingBottom,\n paddingTop: textAreaStyles.paddingTop,\n paddingLeft: textAreaStyles.paddingLeft,\n paddingRight: textAreaStyles.paddingRight,\n margin: textAreaStyles.margin,\n border: textAreaStyles.border,\n borderTop: textAreaStyles.borderTop,\n borderBottom: textAreaStyles.borderBottom,\n borderLeft: textAreaStyles.borderLeft,\n borderRight: textAreaStyles.borderRight,\n fontFamily: textAreaStyles.fontFamily,\n fontSize: textAreaStyles.fontSize,\n lineHeight: textAreaStyles.lineHeight,\n tabSize: textAreaStyles.tabSize,\n textIndent: textAreaStyles.textIndent,\n textRendering: textAreaStyles.textRendering,\n textTransform: textAreaStyles.textTransform,\n display: textAreaStyles.display,\n whiteSpace: textAreaStyles.whiteSpace,\n wordBreak: textAreaStyles.wordBreak,\n } as React.CSSProperties;\n\n if (!deepEqual(newFakeStyles, ctx.get(fakeStylesAtom))) {\n fakeStylesAtom(ctx, newFakeStyles);\n }\n\n const computedStyle = getComputedStyle(fakeElement);\n const lineHeight = parseFloat(computedStyle.lineHeight);\n\n const paddingTop = parseFloat(computedStyle.paddingTop);\n const paddingBottom = parseFloat(computedStyle.paddingBottom);\n const borderTop = parseFloat(computedStyle.borderTopWidth);\n const borderBottom = parseFloat(computedStyle.borderBottomWidth);\n\n const gap = paddingTop + paddingBottom + borderTop + borderBottom;\n\n const newHeight = fakeElement.scrollHeight;\n\n const minHeight = minRows * lineHeight + gap;\n const maxHeight = maxRows ? maxRows * lineHeight + gap : Infinity;\n\n const finalHeight = Math.min(Math.max(newHeight, minHeight), maxHeight);\n\n if (isNaN(finalHeight)) {\n return;\n }\n\n const newTextareaStyles: React.CSSProperties = {\n height: `${finalHeight}px`,\n overflowY: maxRows && newHeight > maxHeight ? 'scroll' : 'hidden',\n };\n\n if (!deepEqual(newTextareaStyles, ctx.get(textareaStylesAtom))) {\n textareaStylesAtom(ctx, newTextareaStyles);\n }\n });\n\n const handleChange: React.ChangeEventHandler<HTMLTextAreaElement> =\n useAction((ctx, e) => {\n ctx.get(propsAtom).onChange?.(e);\n const fakeElement = ctx.get(fakeElementAtom);\n if (fakeElement) {\n fakeElement.value = e.target.value;\n }\n calculateHeight();\n });\n\n useUpdate(calculateHeight, [\n minRows,\n maxRows,\n fakeElementAtom,\n textAreaElementAtom,\n ]);\n\n useResizeObservedAtom(\n useCreateAtom((ctx) => [\n ctx.spy(textAreaElementAtom),\n ctx.get(fakeElementAtom),\n ]),\n calculateHeight,\n );\n\n useCreateAtom((ctx) => {\n const fakeElement = ctx.spy(fakeElementAtom);\n const textAreaElement = ctx.spy(textAreaElementAtom);\n if (fakeElement && textAreaElement) {\n fakeElement.value = textAreaElement.value;\n calculateHeight();\n }\n });\n\n return (\n <>\n <textarea\n {...restProps}\n ref={useForkRef([textAreaRef, ref])}\n onChange={handleChange}\n style={{ ...style, ...textareaStyles }}\n className={cnTextAreaAutoSize(null, [className])}\n />\n {createPortal(\n <textarea\n ref={fakeRef}\n style={fakeStyles}\n className={cnTextAreaAutoSize('Fake')}\n id={cnTextAreaAutoSize('Fake', {\n id: restProps.id,\n name: restProps.name,\n })}\n />,\n document.body,\n )}\n </>\n );\n }),\n);\n"],"mappings":"83BAAA,+BAEA,OAASA,SAAT,CAAoBC,OAApB,CAA6BC,SAA7B,KAA8C,mBAA9C,CACA,MAAOC,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CACA,OAASC,YAAT,KAA6B,WAA7B,CAEA,OAASC,UAAT,8BACA,OAASC,EAAT,uBACA,OAASC,SAAT,iCACA,OACEC,aADF,CAEEC,UAFF,CAGEC,qBAHF,CAIEC,aAJF,CAKEC,OALF,yBAQA,MAAO,IAAMC,mBAAkB,CAAGP,EAAE,CAAC,kBAAD,CAA7B,CAOP,MAAO,IAAMQ,iBAAgB,CAAGF,OAAO,CACrCT,UAAU,CAA6C,SAACY,CAAD,CAAQC,CAAR,CAAgB,OAQjED,CARiE,CAEnEE,OAFmE,CAEnEA,CAFmE,YAEzD,CAFyD,GAGnEC,CAHmE,CAQjEH,CARiE,CAGnEG,OAHmE,CAInEC,CAJmE,CAQjEJ,CARiE,CAInEI,QAJmE,CAKnEC,CALmE,CAQjEL,CARiE,CAKnEK,KALmE,CAMnEC,CANmE,CAQjEN,CARiE,CAMnEM,SANmE,CAOhEC,CAPgE,0BAQjEP,CARiE,cAWnEN,UAAU,EAXyD,uBAU9Dc,CAV8D,MAUzCC,CAVyC,QAYlCf,UAAU,EAZwB,uBAY9DgB,CAZ8D,MAY7CC,CAZ6C,QActB1B,OAAO,CACpD,EADoD,CAde,uBAc9D2B,CAd8D,MAc5CC,CAd4C,QAiB9B5B,OAAO,CAAsB,EAAtB,CAjBuB,uBAiB9D6B,CAjB8D,MAiBhDC,CAjBgD,MAmB/DC,CAAS,CAAGpB,aAAa,CAACI,CAAD,CAnBsC,CAqB/DiB,CAAe,CAAG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,CADP,CAEE,KAAK,CAAEG,CAFT,CAGE,SAAS,CAAEhB,kBAAkB,CAAC,MAAD,CAH/B,CAIE,EAAE,CAAEA,kBAAkB,CAAC,MAAD,CAAS,CAC7BuE,EAAE,CAAE9D,CAAS,CAAC8D,EADe,CAE7BC,IAAI,CAAE/D,CAAS,CAAC+D,IAFa,CAAT,CAJxB,EADW,CAUXC,QAAQ,CAACC,IAVE,CARf,CAsBH,CAnJS,CAD2B,CAAhC"}
|
|
1
|
+
{"version":3,"file":"TextAreaAutoSize.js","names":["useAction","useAtom","useUpdate","React","forwardRef","createPortal","useForkRef","cn","deepEqual","useCreateAtom","useRefAtom","useResizeObservedAtom","useSendToAtom","withCtx","cnTextAreaAutoSize","TextAreaAutoSize","props","ref","minRows","maxRows","onChange","style","className","restProps","textAreaElementAtom","textAreaRef","fakeElementAtom","fakeRef","textareaStyles","textareaStylesAtom","fakeStyles","fakeStylesAtom","propsAtom","calculateHeight","ctx","textAreaElement","get","fakeElement","textAreaStyles","getComputedStyle","newFakeStyles","minHeight","maxHeight","width","paddingBottom","paddingTop","paddingLeft","paddingRight","margin","border","borderTop","borderBottom","borderLeft","borderRight","fontFamily","fontSize","lineHeight","tabSize","textIndent","textRendering","textTransform","display","whiteSpace","wordBreak","computedStyle","parseFloat","borderTopWidth","borderBottomWidth","gap","newHeight","scrollHeight","finalHeight","Math","min","max","isNaN","newTextareaStyles","height","overflowY","handleChange","e","value","target","spy","id","name","document","body"],"sources":["../../../../../src/components/TextAreaAutoSize/TextAreaAutoSize.tsx"],"sourcesContent":["import './TextAreaAutoSize.css';\n\nimport { useAction, useAtom, useUpdate } from '@reatom/npm-react';\nimport React, { forwardRef } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { cn } from '##/utils/bem';\nimport { deepEqual } from '##/utils/objectCompare';\nimport {\n useCreateAtom,\n useRefAtom,\n useResizeObservedAtom,\n useSendToAtom,\n withCtx,\n} from '##/utils/state';\n\nexport const cnTextAreaAutoSize = cn('TextAreaAutoSize');\n\nexport type TextAreaAutoSizeProps = {\n minRows?: number;\n maxRows?: number;\n} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nexport const TextAreaAutoSize = withCtx(\n forwardRef<HTMLTextAreaElement, TextAreaAutoSizeProps>((props, ref) => {\n const {\n minRows = 1,\n maxRows,\n onChange,\n style,\n className,\n ...restProps\n } = props;\n\n const [textAreaElementAtom, textAreaRef] =\n useRefAtom<HTMLTextAreaElement>();\n const [fakeElementAtom, fakeRef] = useRefAtom<HTMLTextAreaElement>();\n\n const [textareaStyles, , textareaStylesAtom] = useAtom<React.CSSProperties>(\n {},\n );\n const [fakeStyles, , fakeStylesAtom] = useAtom<React.CSSProperties>({});\n\n const propsAtom = useSendToAtom(props);\n\n const calculateHeight = useAction((ctx) => {\n const textAreaElement = ctx.get(textAreaElementAtom);\n const fakeElement = ctx.get(fakeElementAtom);\n\n if (!textAreaElement || !fakeElement) return;\n const textAreaStyles = getComputedStyle(textAreaElement);\n\n const newFakeStyles = {\n minHeight: textAreaStyles.minHeight,\n maxHeight: textAreaStyles.maxHeight,\n width: textAreaStyles.width,\n paddingBottom: textAreaStyles.paddingBottom,\n paddingTop: textAreaStyles.paddingTop,\n paddingLeft: textAreaStyles.paddingLeft,\n paddingRight: textAreaStyles.paddingRight,\n margin: textAreaStyles.margin,\n border: textAreaStyles.border,\n borderTop: textAreaStyles.borderTop,\n borderBottom: textAreaStyles.borderBottom,\n borderLeft: textAreaStyles.borderLeft,\n borderRight: textAreaStyles.borderRight,\n fontFamily: textAreaStyles.fontFamily,\n fontSize: textAreaStyles.fontSize,\n lineHeight: textAreaStyles.lineHeight,\n tabSize: textAreaStyles.tabSize,\n textIndent: textAreaStyles.textIndent,\n textRendering: textAreaStyles.textRendering,\n textTransform: textAreaStyles.textTransform,\n display: textAreaStyles.display,\n whiteSpace: textAreaStyles.whiteSpace,\n wordBreak: textAreaStyles.wordBreak,\n } as React.CSSProperties;\n\n if (!deepEqual(newFakeStyles, ctx.get(fakeStylesAtom))) {\n fakeStylesAtom(ctx, newFakeStyles);\n }\n\n const computedStyle = getComputedStyle(fakeElement);\n const lineHeight = parseFloat(computedStyle.lineHeight);\n\n const paddingTop = parseFloat(computedStyle.paddingTop);\n const paddingBottom = parseFloat(computedStyle.paddingBottom);\n const borderTop = parseFloat(computedStyle.borderTopWidth);\n const borderBottom = parseFloat(computedStyle.borderBottomWidth);\n\n const gap = paddingTop + paddingBottom + borderTop + borderBottom;\n\n const newHeight = fakeElement.scrollHeight;\n\n const minHeight = minRows * lineHeight + gap;\n const maxHeight = maxRows ? maxRows * lineHeight + gap : Infinity;\n\n const finalHeight = Math.min(Math.max(newHeight, minHeight), maxHeight);\n\n if (isNaN(finalHeight)) {\n return;\n }\n\n const newTextareaStyles: React.CSSProperties = {\n height: `${finalHeight}px`,\n overflowY: maxRows && newHeight > maxHeight ? 'scroll' : 'hidden',\n };\n\n if (!deepEqual(newTextareaStyles, ctx.get(textareaStylesAtom))) {\n textareaStylesAtom(ctx, newTextareaStyles);\n }\n });\n\n const handleChange: React.ChangeEventHandler<HTMLTextAreaElement> =\n useAction((ctx, e) => {\n ctx.get(propsAtom).onChange?.(e);\n const fakeElement = ctx.get(fakeElementAtom);\n if (fakeElement) {\n fakeElement.value = e.target.value;\n }\n calculateHeight();\n });\n\n useUpdate(calculateHeight, [\n minRows,\n maxRows,\n fakeElementAtom,\n textAreaElementAtom,\n ]);\n\n useResizeObservedAtom(\n useCreateAtom((ctx) => [\n ctx.spy(textAreaElementAtom),\n ctx.get(fakeElementAtom),\n ]),\n calculateHeight,\n );\n\n useCreateAtom((ctx) => {\n const fakeElement = ctx.spy(fakeElementAtom);\n const textAreaElement = ctx.spy(textAreaElementAtom);\n if (fakeElement && textAreaElement) {\n fakeElement.value = textAreaElement.value;\n calculateHeight();\n }\n });\n\n return (\n <>\n <textarea\n {...restProps}\n ref={useForkRef([textAreaRef, ref])}\n onChange={handleChange}\n style={{ ...style, ...textareaStyles }}\n className={cnTextAreaAutoSize(null, [className])}\n />\n {createPortal(\n <textarea\n ref={fakeRef}\n style={fakeStyles}\n className={cnTextAreaAutoSize('Fake')}\n id={cnTextAreaAutoSize('Fake', {\n id: restProps.id,\n name: restProps.name,\n })}\n />,\n document.body,\n )}\n </>\n );\n }),\n);\n"],"mappings":"83BAAA,+BAEA,OAASA,SAAT,CAAoBC,OAApB,CAA6BC,SAA7B,KAA8C,mBAA9C,CACA,MAAOC,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CACA,OAASC,YAAT,KAA6B,WAA7B,CAEA,OAASC,UAAT,8BACA,OAASC,EAAT,uBACA,OAASC,SAAT,iCACA,OACEC,aADF,CAEEC,UAFF,CAGEC,qBAHF,CAIEC,aAJF,CAKEC,OALF,yBAQA,MAAO,IAAMC,mBAAkB,CAAGP,EAAE,CAAC,kBAAD,CAA7B,CAOP,MAAO,IAAMQ,iBAAgB,CAAGF,OAAO,CACrCT,UAAU,CAA6C,SAACY,CAAD,CAAQC,CAAR,CAAgB,OAQjED,CARiE,CAEnEE,OAFmE,CAEnEA,CAFmE,YAEzD,CAFyD,GAGnEC,CAHmE,CAQjEH,CARiE,CAGnEG,OAHmE,CAInEC,CAJmE,CAQjEJ,CARiE,CAInEI,QAJmE,CAKnEC,CALmE,CAQjEL,CARiE,CAKnEK,KALmE,CAMnEC,CANmE,CAQjEN,CARiE,CAMnEM,SANmE,CAOhEC,CAPgE,0BAQjEP,CARiE,cAWnEN,UAAU,EAXyD,uBAU9Dc,CAV8D,MAUzCC,CAVyC,QAYlCf,UAAU,EAZwB,uBAY9DgB,CAZ8D,MAY7CC,CAZ6C,QActB1B,OAAO,CACpD,EADoD,CAde,uBAc9D2B,CAd8D,MAc5CC,CAd4C,QAiB9B5B,OAAO,CAAsB,EAAtB,CAjBuB,uBAiB9D6B,CAjB8D,MAiBhDC,CAjBgD,MAmB/DC,CAAS,CAAGpB,aAAa,CAACI,CAAD,CAnBsC,CAqB/D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AGE,SAAS,CAAEhB,kBAAkB,CAAC,MAAD,CAH/B,CAIE,EAAE,CAAEA,kBAAkB,CAAC,MAAD,CAAS,CAC7BsE,EAAE,CAAE7D,CAAS,CAAC6D,EADe,CAE7BC,IAAI,CAAE9D,CAAS,CAAC8D,IAFa,CAAT,CAJxB,EADW,CAUXC,QAAQ,CAACC,IAVE,CARf,CAsBH,CAlJS,CAD2B,CAAhC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React,{forwardRef}from"react";import{TextFieldTypeNumber}from"./TextFieldTypeNumber";import{TextFieldTypePassword}from"./TextFieldTypePassword";import{TextFieldTypeText}from"./TextFieldTypeText";import{TextFieldTypeTextArea}from"./TextFieldTypeTextArea";import{TextFieldTypeTextArray}from"./TextFieldTypeTextArray";var typeMap={text:TextFieldTypeText,textarea:TextFieldTypeTextArea,password:TextFieldTypePassword,number:TextFieldTypeNumber,textarray:TextFieldTypeTextArray},TextFieldRender=function(a,b){var c=typeMap[a.type||"text"]||typeMap.text;return React.createElement(c,Object.assign({ref:b},a))};export var TextField=forwardRef(TextFieldRender);
|
|
1
|
+
import React,{forwardRef}from"react";import{clearUndefined}from"../../utils/object";import{TextFieldTypeNumber}from"./TextFieldTypeNumber";import{TextFieldTypePassword}from"./TextFieldTypePassword";import{TextFieldTypeText}from"./TextFieldTypeText";import{TextFieldTypeTextArea}from"./TextFieldTypeTextArea";import{TextFieldTypeTextArray}from"./TextFieldTypeTextArray";var typeMap={text:TextFieldTypeText,textarea:TextFieldTypeTextArea,password:TextFieldTypePassword,number:TextFieldTypeNumber,textarray:TextFieldTypeTextArray},TextFieldRender=function(a,b){var c=typeMap[a.type||"text"]||typeMap.text;return React.createElement(c,Object.assign({ref:b},clearUndefined(a)))};export var TextField=forwardRef(TextFieldRender);
|
|
2
2
|
//# sourceMappingURL=TextFieldCanary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextFieldCanary.js","names":["React","forwardRef","TextFieldTypeNumber","TextFieldTypePassword","TextFieldTypeText","TextFieldTypeTextArea","TextFieldTypeTextArray","typeMap","text","textarea","password","number","textarray","TextFieldRender","props","ref","Component","type","TextField"],"sources":["../../../../../src/components/TextFieldCanary/TextFieldCanary.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { TextFieldTypeNumber } from './TextFieldTypeNumber';\nimport { TextFieldTypePassword } from './TextFieldTypePassword';\nimport { TextFieldTypeText } from './TextFieldTypeText';\nimport { TextFieldTypeTextArea } from './TextFieldTypeTextArea';\nimport { TextFieldTypeTextArray } from './TextFieldTypeTextArray';\nimport {\n TextFieldComponent,\n TextFieldProps,\n TextFieldTypeComponent,\n} from './types';\n\nconst typeMap: Record<\n string,\n | TextFieldTypeComponent<'text'>\n | TextFieldTypeComponent<'textarea'>\n | TextFieldTypeComponent<'password'>\n | TextFieldTypeComponent<'number'>\n | TextFieldTypeComponent<'textarray'>\n> = {\n text: TextFieldTypeText,\n textarea: TextFieldTypeTextArea,\n password: TextFieldTypePassword,\n number: TextFieldTypeNumber,\n textarray: TextFieldTypeTextArray,\n};\n\nconst TextFieldRender = <TYPE extends string>(\n props: TextFieldProps<TYPE>,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const Component = (typeMap[props.type || 'text'] ||\n typeMap.text) as TextFieldTypeComponent<TYPE>;\n\n return <Component ref={ref} {...props} />;\n};\n\nexport const TextField = forwardRef(TextFieldRender) as TextFieldComponent;\n"],"mappings":"AAAA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,mBAAT,6BACA,OAASC,qBAAT,+BACA,OAASC,iBAAT,2BACA,OAASC,qBAAT,+BACA,OAASC,sBAAT,gC,GAOMC,QAOL,CAAG,CACFC,IAAI,CAAEJ,iBADJ,CAEFK,QAAQ,CAAEJ,qBAFR,CAGFK,QAAQ,CAAEP,qBAHR,CAIFQ,MAAM,CAAET,mBAJN,CAKFU,SAAS,CAAEN,sBALT,C,CAQEO,eAAe,CAAG,SACtBC,CADsB,CAEtBC,CAFsB,CAGnB,CACH,GAAMC,EAAS,CAAIT,OAAO,CAACO,CAAK,CAACG,IAAN,EAAc,MAAf,CAAP,EACjBV,OAAO,CAACC,IADV,CAGA,MAAO,qBAAC,CAAD,gBAAW,GAAG,CAAEO,CAAhB,
|
|
1
|
+
{"version":3,"file":"TextFieldCanary.js","names":["React","forwardRef","clearUndefined","TextFieldTypeNumber","TextFieldTypePassword","TextFieldTypeText","TextFieldTypeTextArea","TextFieldTypeTextArray","typeMap","text","textarea","password","number","textarray","TextFieldRender","props","ref","Component","type","TextField"],"sources":["../../../../../src/components/TextFieldCanary/TextFieldCanary.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { clearUndefined } from '##/utils/object';\n\nimport { TextFieldTypeNumber } from './TextFieldTypeNumber';\nimport { TextFieldTypePassword } from './TextFieldTypePassword';\nimport { TextFieldTypeText } from './TextFieldTypeText';\nimport { TextFieldTypeTextArea } from './TextFieldTypeTextArea';\nimport { TextFieldTypeTextArray } from './TextFieldTypeTextArray';\nimport {\n TextFieldComponent,\n TextFieldProps,\n TextFieldTypeComponent,\n} from './types';\n\nconst typeMap: Record<\n string,\n | TextFieldTypeComponent<'text'>\n | TextFieldTypeComponent<'textarea'>\n | TextFieldTypeComponent<'password'>\n | TextFieldTypeComponent<'number'>\n | TextFieldTypeComponent<'textarray'>\n> = {\n text: TextFieldTypeText,\n textarea: TextFieldTypeTextArea,\n password: TextFieldTypePassword,\n number: TextFieldTypeNumber,\n textarray: TextFieldTypeTextArray,\n};\n\nconst TextFieldRender = <TYPE extends string>(\n props: TextFieldProps<TYPE>,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const Component = (typeMap[props.type || 'text'] ||\n typeMap.text) as TextFieldTypeComponent<TYPE>;\n\n return <Component ref={ref} {...clearUndefined(props)} />;\n};\n\nexport const TextField = forwardRef(TextFieldRender) as TextFieldComponent;\n"],"mappings":"AAAA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,cAAT,0BAEA,OAASC,mBAAT,6BACA,OAASC,qBAAT,+BACA,OAASC,iBAAT,2BACA,OAASC,qBAAT,+BACA,OAASC,sBAAT,gC,GAOMC,QAOL,CAAG,CACFC,IAAI,CAAEJ,iBADJ,CAEFK,QAAQ,CAAEJ,qBAFR,CAGFK,QAAQ,CAAEP,qBAHR,CAIFQ,MAAM,CAAET,mBAJN,CAKFU,SAAS,CAAEN,sBALT,C,CAQEO,eAAe,CAAG,SACtBC,CADsB,CAEtBC,CAFsB,CAGnB,CACH,GAAMC,EAAS,CAAIT,OAAO,CAACO,CAAK,CAACG,IAAN,EAAc,MAAf,CAAP,EACjBV,OAAO,CAACC,IADV,CAGA,MAAO,qBAAC,CAAD,gBAAW,GAAG,CAAEO,CAAhB,EAAyBd,cAAc,CAACa,CAAD,CAAvC,EACR,C,CAED,MAAO,IAAMI,UAAS,CAAGlB,UAAU,CAACa,eAAD,CAA5B"}
|
|
@@ -1 +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_hovered{background-color:var(--color-control-bg-clear-hover)}.UserSelectItem_disable{color:var(--color-control-typo-disable);cursor:auto}.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
|
+
.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_hovered{background-color:var(--color-control-bg-clear-hover)}.UserSelectItem_disable{color:var(--color-control-typo-disable);cursor:auto}.UserSelectItem_active,.UserSelectItem_active .UserSelectItem-Label,.UserSelectItem_active .UserSelectItem-SubLabel{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{flex:1;padding-left:var(--sub-info-space)}.UserSelectItem-Label,.UserSelectItem-SubLabel{word-wrap:break-word;-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;line-height:var(--line-height-text-m);overflow:hidden}.UserSelectItem-Label{max-width:20ch}.UserSelectItem-SubLabel{font-size:var(--sub-label-font-size);max-width:28ch;opacity:.7}.UserSelectItem-SubLabel_disable{opacity:1}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import './UserSelectItem.css';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { UserSelectPropSize } from '../helpers';
|
|
3
4
|
export declare const cnUserSelectItem: import("@bem-react/classname").ClassNameFormatter;
|
|
4
5
|
export declare const UserSelectItem: React.ForwardRefExoticComponent<{
|
|
5
6
|
label: string;
|
|
6
7
|
active: boolean;
|
|
7
8
|
hovered: boolean;
|
|
8
|
-
size:
|
|
9
|
+
size: UserSelectPropSize;
|
|
9
10
|
indent: "normal" | "increased";
|
|
10
11
|
subLabel?: string;
|
|
11
12
|
avatarUrl?: string;
|
|
@@ -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{mapHorizontalSpace,mapHorizontalSpaceIncreased,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?mapHorizontalSpaceIncreased[i]:mapHorizontalSpace[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,monochrome:k}),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")})),
|
|
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{mapHorizontalSpace,mapHorizontalSpaceIncreased,mapItemVerticalPadding}from"../../ListCanary";import{cnMixSpace}from"../../../mixs/MixSpace";import{cn}from"../../../utils/bem";import{Text}from"../../Text/Text";export var cnUserSelectItem=cn("UserSelectItem");var avatarSizeMap={s:"s",m:"m",l:"m"};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?mapHorizontalSpaceIncreased[i]:mapHorizontalSpace[i],pV:mapItemVerticalPadding[i]}),c]),"aria-selected":g,ref:b}),React.createElement("div",{className:cnUserSelectItem("AvatarContainer")},React.createElement(Avatar,{className:cnUserSelectItem("Avatar"),size:avatarSizeMap[i],url:f,name:d,monochrome:k}),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")})),React.createElement("div",{className:cnUserSelectItem("Info")},d&&React.createElement(Text,{className:cnUserSelectItem("Label")},d),e&&React.createElement(Text,{className:cnUserSelectItem("SubLabel",{disable:k})},e)))});
|
|
2
2
|
//# sourceMappingURL=UserSelectItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserSelectItem.js","names":["IconCheck","React","forwardRef","useRef","Transition","Avatar","mapHorizontalSpace","mapHorizontalSpaceIncreased","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 mapHorizontalSpace,\n mapHorizontalSpaceIncreased,\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:
|
|
1
|
+
{"version":3,"file":"UserSelectItem.js","names":["IconCheck","React","forwardRef","useRef","Transition","Avatar","mapHorizontalSpace","mapHorizontalSpaceIncreased","mapItemVerticalPadding","cnMixSpace","cn","Text","cnUserSelectItem","avatarSizeMap","s","m","l","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 { IconPropSize } from '@consta/icons/Icon';\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 mapHorizontalSpace,\n mapHorizontalSpaceIncreased,\n mapItemVerticalPadding,\n} from '##/components/ListCanary';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\nimport { PropsWithHTMLAttributes } from '##/utils/types/PropsWithHTMLAttributes';\n\nimport { Text } from '../../Text/Text';\nimport { UserSelectPropSize } from '../helpers';\n\ntype UserSelectItemProps = PropsWithHTMLAttributes<\n {\n label: string;\n active: boolean;\n hovered: boolean;\n size: UserSelectPropSize;\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\nconst avatarSizeMap: Record<UserSelectPropSize, IconPropSize> = {\n s: 's',\n m: 'm',\n l: 'm',\n};\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 ? mapHorizontalSpaceIncreased[size]\n : mapHorizontalSpace[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 size={avatarSizeMap[size]}\n url={avatarUrl}\n name={label}\n monochrome={disable}\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 <div className={cnUserSelectItem('Info')}>\n {label && <Text className={cnUserSelectItem('Label')}>{label}</Text>}\n {subLabel && (\n <Text className={cnUserSelectItem('SubLabel', { disable })}>\n {subLabel}\n </Text>\n )}\n </div>\n </div>\n );\n },\n);\n"],"mappings":"wMAAA,6BAGA,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,0BAGA,OAASC,IAAT,uBAkBA,MAAO,IAAMC,iBAAgB,CAAGF,EAAE,CAAC,gBAAD,CAA3B,CAEP,GAAMG,cAAuD,CAAG,CAC9DC,CAAC,CAAE,GAD2D,CAE9DC,CAAC,CAAE,GAF2D,CAG9DC,CAAC,CAAE,GAH2D,CAAhE,CAMA,MAAO,IAAMC,eAAc,CAAGf,UAAU,CACtC,SAACgB,CAAD,CAAQC,CAAR,CAAgB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,CAEE,aAAa,GAFf,CAGE,OAAO,CAAE,GAHX,CAIE,OAAO,CAAEO,CAJX,EAMG,SAACG,CAAD,QACC,qBAAC,SAAD,EACE,SAAS,CAAEtB,gBAAgB,CAAC,WAAD,CAAc,CAAEsB,OAAO,CAAPA,CAAF,CAAd,CAD7B,CAEE,GAAG,CAAEH,CAFP,EADD,CANH,CATJ,CAuBG,CAACF,CAAD,EAAaL,CAAb,EACC,oBAAC,SAAD,EAAW,SAAS,CAAEZ,gBAAgB,CAAC,WAAD,CAAtC,EAxBJ,CAlBF,CA6CE,2BAAK,SAAS,CAAEA,gBAAgB,CAAC,MAAD,CAAhC,EACGS,CAAK,EAAI,oBAAC,IAAD,EAAM,SAAS,CAAET,gBAAgB,CAAC,OAAD,CAAjC,EAA6CS,CAA7C,CADZ,CAEGC,CAAQ,EACP,oBAAC,IAAD,EAAM,SAAS,CAAEV,gBAAgB,CAAC,UAAD,CAAa,CAAEgB,OAAO,CAAPA,CAAF,CAAb,CAAjC,EACGN,CADH,CAHJ,CA7CF,CAuDH,CA1EqC,CAAjC"}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
.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,8 +1,9 @@
|
|
|
1
1
|
import './UserSelectValue.css';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { UserSelectPropSize } from '../helpers';
|
|
3
4
|
type UserValueProps = {
|
|
4
5
|
label: string;
|
|
5
|
-
size:
|
|
6
|
+
size: UserSelectPropSize;
|
|
6
7
|
subLabel?: string;
|
|
7
8
|
avatarUrl?: string;
|
|
8
9
|
handleRemove?: (e: React.SyntheticEvent) => void;
|
|
@@ -1 +1 @@
|
|
|
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:
|
|
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';\nimport { UserSelectPropSize } from '../helpers';\n\ntype UserValueProps = {\n label: string;\n size: UserSelectPropSize;\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,uBAcA,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"}
|
|
@@ -33,10 +33,11 @@ type UserSelectPropOnChange<ITEM, MULTIPLE extends boolean> = (value: (MULTIPLE
|
|
|
33
33
|
type UserSelectPropValue<ITEM, MULTIPLE extends boolean> = (MULTIPLE extends true ? ITEM[] : ITEM) | null | undefined;
|
|
34
34
|
export type UserSelectPropRenderItem<ITEM> = (props: RenderItemProps<ITEM>) => React.ReactNode | null;
|
|
35
35
|
export type UserSelectPropRenderValue<ITEM> = (props: UserSelectRenderValueProps<ITEM>) => React.ReactNode | null;
|
|
36
|
+
export type UserSelectPropSize = Exclude<PropSize, 'xs'>;
|
|
36
37
|
export type UserSelectProps<ITEM = UserSelectItemDefault, GROUP = UserSelectGroupDefault, MULTIPLE extends boolean = false> = PropsWithHTMLAttributesAndRef<{
|
|
37
38
|
disabled?: boolean;
|
|
38
39
|
form?: PropForm;
|
|
39
|
-
size?:
|
|
40
|
+
size?: UserSelectPropSize;
|
|
40
41
|
view?: PropView;
|
|
41
42
|
dropdownForm?: 'default' | 'brick' | 'round';
|
|
42
43
|
placeholder?: string;
|
|
@@ -115,7 +116,7 @@ export declare const isNotMultipleParams: <ITEM, GROUP>(params: UserSelectProps<
|
|
|
115
116
|
export declare function withDefaultGetters<ITEM = UserSelectItemDefault, GROUP = UserSelectGroupDefault, MULTIPLE extends boolean = false>(props: UserSelectProps<ITEM, GROUP, MULTIPLE>): {
|
|
116
117
|
disabled?: boolean;
|
|
117
118
|
form?: PropForm;
|
|
118
|
-
size?:
|
|
119
|
+
size?: UserSelectPropSize;
|
|
119
120
|
view?: PropView;
|
|
120
121
|
dropdownForm?: "default" | "brick" | "round";
|
|
121
122
|
placeholder?: string;
|
|
@@ -190,6 +191,6 @@ export declare function withDefaultGetters<ITEM = UserSelectItemDefault, GROUP =
|
|
|
190
191
|
getItemAvatarUrl: UserSelectPropGetItemAvatarUrl<UserSelectItemDefault> | UserSelectPropGetItemAvatarUrl<ITEM>;
|
|
191
192
|
};
|
|
192
193
|
export declare const searchCompare: (searchValue: string, compare?: string) => boolean;
|
|
193
|
-
export declare const clearSizeMap: Record<
|
|
194
|
-
export declare const iconSizeMap: Record<
|
|
194
|
+
export declare const clearSizeMap: Record<UserSelectPropSize, IconPropSize>;
|
|
195
|
+
export declare const iconSizeMap: Record<UserSelectPropSize, IconPropSize>;
|
|
195
196
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";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}export var defaultGetItemKey=function(a){return a.id};export var defaultGetItemLabel=function(a){return a.label};export var defaultGetItemSubLabel=function(a){return a.subLabel};export var defaultGetItemAvatarUrl=function(a){return a.avatarUrl};export var defaultGetItemGroupKey=function(a){return a.groupId};export var defaultGetItemDisabled=function(a){return a.disabled};export var defaultGetGroupKey=function(a){return a.id};export var defaultGetGroupLabel=function(a){return a.label};export var isMultipleParams=function(a){return!!a.multiple};export var isNotMultipleParams=function(a){return!a.multiple};export function withDefaultGetters(a){return _objectSpread(_objectSpread({},a),{},{getItemLabel:a.getItemLabel||defaultGetItemLabel,getItemKey:a.getItemKey||defaultGetItemKey,getItemGroupKey:a.getItemGroupKey||defaultGetItemGroupKey,getItemDisabled:a.getItemDisabled||defaultGetItemDisabled,getGroupLabel:a.getGroupLabel||defaultGetGroupLabel,getGroupKey:a.getGroupKey||defaultGetGroupKey,getItemSubLabel:a.getItemSubLabel||defaultGetItemSubLabel,getItemAvatarUrl:a.getItemAvatarUrl||defaultGetItemAvatarUrl})}export var searchCompare=function(a,b){return!!b&&-1!==b.toLocaleLowerCase().indexOf(a.toLocaleLowerCase())};export var clearSizeMap={
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";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}export var defaultGetItemKey=function(a){return a.id};export var defaultGetItemLabel=function(a){return a.label};export var defaultGetItemSubLabel=function(a){return a.subLabel};export var defaultGetItemAvatarUrl=function(a){return a.avatarUrl};export var defaultGetItemGroupKey=function(a){return a.groupId};export var defaultGetItemDisabled=function(a){return a.disabled};export var defaultGetGroupKey=function(a){return a.id};export var defaultGetGroupLabel=function(a){return a.label};export var isMultipleParams=function(a){return!!a.multiple};export var isNotMultipleParams=function(a){return!a.multiple};export function withDefaultGetters(a){return _objectSpread(_objectSpread({},a),{},{getItemLabel:a.getItemLabel||defaultGetItemLabel,getItemKey:a.getItemKey||defaultGetItemKey,getItemGroupKey:a.getItemGroupKey||defaultGetItemGroupKey,getItemDisabled:a.getItemDisabled||defaultGetItemDisabled,getGroupLabel:a.getGroupLabel||defaultGetGroupLabel,getGroupKey:a.getGroupKey||defaultGetGroupKey,getItemSubLabel:a.getItemSubLabel||defaultGetItemSubLabel,getItemAvatarUrl:a.getItemAvatarUrl||defaultGetItemAvatarUrl})}export var searchCompare=function(a,b){return!!b&&-1!==b.toLocaleLowerCase().indexOf(a.toLocaleLowerCase())};export var clearSizeMap={s:"s",m:"s",l:"m"};export var iconSizeMap={s:"s",m:"m",l:"m"};
|
|
2
2
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","names":["defaultGetItemKey","item","id","defaultGetItemLabel","label","defaultGetItemSubLabel","subLabel","defaultGetItemAvatarUrl","avatarUrl","defaultGetItemGroupKey","groupId","defaultGetItemDisabled","disabled","defaultGetGroupKey","group","defaultGetGroupLabel","isMultipleParams","params","multiple","isNotMultipleParams","withDefaultGetters","props","getItemLabel","getItemKey","getItemGroupKey","getItemDisabled","getGroupLabel","getGroupKey","getItemSubLabel","getItemAvatarUrl","searchCompare","searchValue","compare","toLocaleLowerCase","indexOf","clearSizeMap","
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["defaultGetItemKey","item","id","defaultGetItemLabel","label","defaultGetItemSubLabel","subLabel","defaultGetItemAvatarUrl","avatarUrl","defaultGetItemGroupKey","groupId","defaultGetItemDisabled","disabled","defaultGetGroupKey","group","defaultGetGroupLabel","isMultipleParams","params","multiple","isNotMultipleParams","withDefaultGetters","props","getItemLabel","getItemKey","getItemGroupKey","getItemDisabled","getGroupLabel","getGroupKey","getItemSubLabel","getItemAvatarUrl","searchCompare","searchValue","compare","toLocaleLowerCase","indexOf","clearSizeMap","s","m","l","iconSizeMap"],"sources":["../../../../../src/components/UserSelect/helpers.ts"],"sourcesContent":["import { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\nimport {\n PropForm,\n PropSize,\n PropStatus,\n PropView,\n RenderItemProps,\n} from '../SelectComponents/types';\n\nexport type UserSelectItemDefault = {\n label: string;\n id: string | number;\n subLabel?: string;\n avatarUrl?: string;\n groupId?: string | number;\n disabled?: boolean;\n};\n\nexport type UserSelectGroupDefault = {\n label: string;\n id: string | number;\n};\n\ntype UserSelectRenderValueProps<ITEM> = {\n item: ITEM;\n handleRemove?: (e: React.SyntheticEvent) => void;\n};\n\nexport type UserSelectPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type UserSelectPropGetItemSubLabel<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type UserSelectPropGetItemAvatarUrl<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type UserSelectPropGetItemKey<ITEM> = (item: ITEM) => string | number;\nexport type UserSelectPropGetItemGroupKey<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\nexport type UserSelectPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\nexport type UserSelectPropGetGroupKey<GROUP> = (\n group: GROUP,\n) => string | number;\nexport type UserSelectPropGetGroupLabel<GROUP> = (group: GROUP) => string;\n\nexport type UserSelectPropSearchFunction<ITEM> = (\n item: ITEM,\n searchValue: string,\n) => boolean;\ntype UserSelectPropOnChange<ITEM, MULTIPLE extends boolean> = (\n value: (MULTIPLE extends true ? ITEM[] : ITEM) | null,\n props: {\n e: React.SyntheticEvent;\n },\n) => void;\ntype UserSelectPropValue<ITEM, MULTIPLE extends boolean> =\n | (MULTIPLE extends true ? ITEM[] : ITEM)\n | null\n | undefined;\n\nexport type UserSelectPropRenderItem<ITEM> = (\n props: RenderItemProps<ITEM>,\n) => React.ReactNode | null;\nexport type UserSelectPropRenderValue<ITEM> = (\n props: UserSelectRenderValueProps<ITEM>,\n) => React.ReactNode | null;\n\nexport type UserSelectPropSize = Exclude<PropSize, 'xs'>;\n\nexport type UserSelectProps<\n ITEM = UserSelectItemDefault,\n GROUP = UserSelectGroupDefault,\n MULTIPLE extends boolean = false,\n> = PropsWithHTMLAttributesAndRef<\n {\n disabled?: boolean;\n form?: PropForm;\n size?: UserSelectPropSize;\n view?: PropView;\n dropdownForm?: 'default' | 'brick' | 'round';\n placeholder?: string;\n ariaLabel?: string;\n dropdownClassName?: string;\n status?: PropStatus;\n dropdownRef?: React.RefObject<HTMLDivElement>;\n name?: string;\n items: ITEM[];\n required?: boolean;\n isLoading?: boolean;\n renderItem?: UserSelectPropRenderItem<ITEM>;\n renderValue?: UserSelectPropRenderValue<ITEM>;\n onFocus?: React.FocusEventHandler<HTMLInputElement>;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n onCreate?: (label: string, props: { e: React.SyntheticEvent }) => void;\n inputRef?: React.RefObject<HTMLInputElement>;\n labelForNotFound?: string;\n labelForCreate?: string;\n labelForEmptyItems?: string;\n searchFunction?: UserSelectPropSearchFunction<ITEM>;\n searchValue?: string;\n multiple?: MULTIPLE;\n value?: UserSelectPropValue<ITEM, MULTIPLE>;\n onChange: UserSelectPropOnChange<ITEM, MULTIPLE>;\n groups?: GROUP[];\n getItemLabel?: UserSelectPropGetItemLabel<ITEM>;\n getItemSubLabel?: UserSelectPropGetItemSubLabel<ITEM>;\n getItemAvatarUrl?: UserSelectPropGetItemAvatarUrl<ITEM>;\n getItemKey?: UserSelectPropGetItemKey<ITEM>;\n getItemGroupKey?: UserSelectPropGetItemGroupKey<ITEM>;\n getItemDisabled?: UserSelectPropGetItemDisabled<ITEM>;\n getGroupLabel?: UserSelectPropGetGroupLabel<GROUP>;\n getGroupKey?: UserSelectPropGetGroupKey<GROUP>;\n label?: string;\n labelIcon?: IconComponent;\n caption?: string;\n labelPosition?: 'top' | 'left';\n virtualScroll?: boolean;\n onScrollToBottom?: (length: number) => void;\n onSearchValueChange?: (value: string) => void;\n onDropdownOpen?: (isOpen: boolean) => void;\n dropdownOpen?: boolean;\n ignoreOutsideClicksRefs?: ReadonlyArray<React.RefObject<HTMLElement>>;\n dropdownViewportRef?: React.RefObject<HTMLElement>;\n },\n HTMLDivElement\n> &\n (ITEM extends { label: UserSelectItemDefault['label'] }\n ? {}\n : { getItemLabel: UserSelectPropGetItemLabel<ITEM> }) &\n (ITEM extends { id: UserSelectItemDefault['id'] }\n ? {}\n : { getItemKey: UserSelectPropGetItemKey<ITEM> }) &\n (GROUP extends { label: UserSelectGroupDefault['label'] }\n ? {}\n : { getGroupLabel: UserSelectPropGetGroupLabel<GROUP> }) &\n (GROUP extends { id: UserSelectGroupDefault['id'] }\n ? {}\n : { getGroupKey: UserSelectPropGetGroupKey<GROUP> });\n\nexport type UserSelectComponent = <\n ITEM = UserSelectItemDefault,\n GROUP = UserSelectGroupDefault,\n MULTIPLE extends boolean = false,\n>(\n props: UserSelectProps<ITEM, GROUP, MULTIPLE>,\n) => React.ReactNode | null;\n\nexport const defaultGetItemKey: UserSelectPropGetItemKey<\n UserSelectItemDefault\n> = (item) => item.id;\nexport const defaultGetItemLabel: UserSelectPropGetItemLabel<\n UserSelectItemDefault\n> = (item) => item.label;\nexport const defaultGetItemSubLabel: UserSelectPropGetItemSubLabel<\n UserSelectItemDefault\n> = (item) => item.subLabel;\nexport const defaultGetItemAvatarUrl: UserSelectPropGetItemAvatarUrl<\n UserSelectItemDefault\n> = (item) => item.avatarUrl;\nexport const defaultGetItemGroupKey: UserSelectPropGetItemGroupKey<\n UserSelectItemDefault\n> = (item) => item.groupId;\nexport const defaultGetItemDisabled: UserSelectPropGetItemDisabled<\n UserSelectItemDefault\n> = (item) => item.disabled;\n\nexport const defaultGetGroupKey: UserSelectPropGetGroupKey<\n UserSelectGroupDefault\n> = (group) => group.id;\nexport const defaultGetGroupLabel: UserSelectPropGetGroupLabel<\n UserSelectGroupDefault\n> = (group) => group.label;\n\nexport const isMultipleParams = <ITEM, GROUP>(\n params: UserSelectProps<ITEM, GROUP, boolean>,\n): params is UserSelectProps<ITEM, GROUP, true> => {\n return !!params.multiple;\n};\n\nexport const isNotMultipleParams = <ITEM, GROUP>(\n params: UserSelectProps<ITEM, GROUP, boolean>,\n): params is UserSelectProps<ITEM, GROUP, false> => {\n return !params.multiple;\n};\n\nexport function withDefaultGetters<\n ITEM = UserSelectItemDefault,\n GROUP = UserSelectGroupDefault,\n MULTIPLE extends boolean = false,\n>(props: UserSelectProps<ITEM, GROUP, MULTIPLE>) {\n return {\n ...props,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemKey: props.getItemKey || defaultGetItemKey,\n getItemGroupKey: props.getItemGroupKey || defaultGetItemGroupKey,\n getItemDisabled: props.getItemDisabled || defaultGetItemDisabled,\n getGroupLabel: props.getGroupLabel || defaultGetGroupLabel,\n getGroupKey: props.getGroupKey || defaultGetGroupKey,\n getItemSubLabel: props.getItemSubLabel || defaultGetItemSubLabel,\n getItemAvatarUrl: props.getItemAvatarUrl || defaultGetItemAvatarUrl,\n };\n}\n\nexport const searchCompare = (\n searchValue: string,\n compare?: string,\n): boolean => {\n if (!compare) {\n return false;\n }\n\n return (\n compare.toLocaleLowerCase().indexOf(searchValue.toLocaleLowerCase()) !== -1\n );\n};\n\nexport const clearSizeMap: Record<UserSelectPropSize, IconPropSize> = {\n s: 's',\n m: 's',\n l: 'm',\n};\n\nexport const iconSizeMap: Record<UserSelectPropSize, IconPropSize> = {\n s: 's',\n m: 'm',\n l: 'm',\n};\n"],"mappings":"qqBAwJA,MAAO,IAAMA,kBAEZ,CAAG,SAACC,CAAD,QAAUA,EAAI,CAACC,EAAf,CAFG,CAGP,MAAO,IAAMC,oBAEZ,CAAG,SAACF,CAAD,QAAUA,EAAI,CAACG,KAAf,CAFG,CAGP,MAAO,IAAMC,uBAEZ,CAAG,SAACJ,CAAD,QAAUA,EAAI,CAACK,QAAf,CAFG,CAGP,MAAO,IAAMC,wBAEZ,CAAG,SAACN,CAAD,QAAUA,EAAI,CAACO,SAAf,CAFG,CAGP,MAAO,IAAMC,uBAEZ,CAAG,SAACR,CAAD,QAAUA,EAAI,CAACS,OAAf,CAFG,CAGP,MAAO,IAAMC,uBAEZ,CAAG,SAACV,CAAD,QAAUA,EAAI,CAACW,QAAf,CAFG,CAIP,MAAO,IAAMC,mBAEZ,CAAG,SAACC,CAAD,QAAWA,EAAK,CAACZ,EAAjB,CAFG,CAGP,MAAO,IAAMa,qBAEZ,CAAG,SAACD,CAAD,QAAWA,EAAK,CAACV,KAAjB,CAFG,CAIP,MAAO,IAAMY,iBAAgB,CAAG,SAC9BC,CAD8B,CAEmB,CACjD,MAAO,CAAC,CAACA,CAAM,CAACC,QACjB,CAJM,CAMP,MAAO,IAAMC,oBAAmB,CAAG,SACjCF,CADiC,CAEiB,CAClD,MAAO,CAACA,CAAM,CAACC,QAChB,CAJM,CAMP,MAAO,SAASE,mBAAT,CAILC,CAJK,CAI0C,CAC/C,sCACKA,CADL,MAEEC,YAAY,CAAED,CAAK,CAACC,YAAN,EAAsBnB,mBAFtC,CAGEoB,UAAU,CAAEF,CAAK,CAACE,UAAN,EAAoBvB,iBAHlC,CAIEwB,eAAe,CAAEH,CAAK,CAACG,eAAN,EAAyBf,sBAJ5C,CAKEgB,eAAe,CAAEJ,CAAK,CAACI,eAAN,EAAyBd,sBAL5C,CAMEe,aAAa,CAAEL,CAAK,CAACK,aAAN,EAAuBX,oBANxC,CAOEY,WAAW,CAAEN,CAAK,CAACM,WAAN,EAAqBd,kBAPpC,CAQEe,eAAe,CAAEP,CAAK,CAACO,eAAN,EAAyBvB,sBAR5C,CASEwB,gBAAgB,CAAER,CAAK,CAACQ,gBAAN,EAA0BtB,uBAT9C,EAWD,CAED,MAAO,IAAMuB,cAAa,CAAG,SAC3BC,CAD2B,CAE3BC,CAF2B,CAGf,SACPA,CADO,EAM+D,CAAC,CAA1E,GAAAA,CAAO,CAACC,iBAAR,GAA4BC,OAA5B,CAAoCH,CAAW,CAACE,iBAAZ,EAApC,CAEH,CAXM,CAaP,MAAO,IAAME,aAAsD,CAAG,CACpEC,CAAC,CAAE,GADiE,CAEpEC,CAAC,CAAE,GAFiE,CAGpEC,CAAC,CAAE,GAHiE,CAA/D,CAMP,MAAO,IAAMC,YAAqD,CAAG,CACnEH,CAAC,CAAE,GADgE,CAEnEC,CAAC,CAAE,GAFgE,CAGnEC,CAAC,CAAE,GAHgE,CAA9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useBodyScrollFreeze';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/hooks/useBodyScrollFreeze/index.ts"],"sourcesContent":["export * from './useBodyScrollFreeze';\n"],"mappings":"AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.BodyScrollFreeze{margin-right:var(--body-scroll-freeze-scrollbar-width)!important;overflow:hidden!important}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const cnBodyScrollFreeze: import("@bem-react/classname").ClassNameFormatter;
|
|
2
|
+
export declare const SCROLLBAR_WIDTH_VAR = "--body-scroll-freeze-scrollbar-width";
|
|
3
|
+
export type UseBodyScrollFreezeProps = {
|
|
4
|
+
isActive?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const useBodyScrollFreeze: ({ isActive, }: UseBodyScrollFreezeProps) => void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useEffect}from"react";import{cn}from"../../utils/bem";export var cnBodyScrollFreeze=cn("BodyScrollFreeze");export var SCROLLBAR_WIDTH_VAR="--body-scroll-freeze-scrollbar-width";var isClassName=function(a,b){return a.classList.contains(b)},addClassName=function(a,b){isClassName(a,b)||a.classList.add(b)},removeClassName=function(a,b){isClassName(a,b)&&a.classList.remove(b)},addCssVariable=function(a,b){document.documentElement.style.setProperty(a,b)},removeCssVariable=function(a){document.documentElement.style.removeProperty(a)},getScrollBarWidth=function(){return"undefined"==typeof window?0:window.innerWidth-document.documentElement.clientWidth},bodyAddStyles=function(){var a=getScrollBarWidth();addCssVariable(SCROLLBAR_WIDTH_VAR,"".concat(a,"px")),addClassName(document.documentElement,cnBodyScrollFreeze())},bodyRemoveStyles=function(){removeClassName(document.documentElement,cnBodyScrollFreeze()),removeCssVariable(SCROLLBAR_WIDTH_VAR)};export var useBodyScrollFreeze=function(a){var b=a.isActive;useEffect(function(){if(b)return"undefined"==typeof window?void 0:(bodyAddStyles(),bodyRemoveStyles)},[b])};
|
|
2
|
+
//# sourceMappingURL=useBodyScrollFreeze.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBodyScrollFreeze.js","names":["useEffect","cn","cnBodyScrollFreeze","SCROLLBAR_WIDTH_VAR","isClassName","element","className","classList","contains","addClassName","add","removeClassName","remove","addCssVariable","variableName","value","document","documentElement","style","setProperty","removeCssVariable","removeProperty","getScrollBarWidth","window","innerWidth","clientWidth","bodyAddStyles","scrollBarWidth","bodyRemoveStyles","useBodyScrollFreeze","isActive"],"sources":["../../../../../src/hooks/useBodyScrollFreeze/useBodyScrollFreeze.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { cn } from '##/utils/bem';\n\nexport const cnBodyScrollFreeze = cn('BodyScrollFreeze');\nexport const SCROLLBAR_WIDTH_VAR = '--body-scroll-freeze-scrollbar-width';\n\nconst isClassName = (element: HTMLElement, className: string) => {\n return element.classList.contains(className);\n};\n\nconst addClassName = (element: HTMLElement, className: string) => {\n if (!isClassName(element, className)) {\n element.classList.add(className);\n }\n};\n\nconst removeClassName = (element: HTMLElement, className: string) => {\n if (isClassName(element, className)) {\n element.classList.remove(className);\n }\n};\n\nconst addCssVariable = (variableName: string, value: string) => {\n document.documentElement.style.setProperty(variableName, value);\n};\n\nconst removeCssVariable = (variableName: string) => {\n document.documentElement.style.removeProperty(variableName);\n};\n\nconst getScrollBarWidth = () =>\n typeof window !== 'undefined'\n ? window.innerWidth - document.documentElement.clientWidth\n : 0;\n\nconst bodyAddStyles = () => {\n const scrollBarWidth = getScrollBarWidth();\n\n addCssVariable(SCROLLBAR_WIDTH_VAR, `${scrollBarWidth}px`);\n\n addClassName(document.documentElement, cnBodyScrollFreeze());\n};\n\nconst bodyRemoveStyles = () => {\n removeClassName(document.documentElement, cnBodyScrollFreeze());\n\n removeCssVariable(SCROLLBAR_WIDTH_VAR);\n};\n\nexport type UseBodyScrollFreezeProps = {\n isActive?: boolean;\n};\n\nexport const useBodyScrollFreeze = ({\n isActive,\n}: UseBodyScrollFreezeProps): void => {\n useEffect(() => {\n if (!isActive) return;\n if (typeof window === 'undefined') return;\n\n bodyAddStyles();\n\n return bodyRemoveStyles;\n }, [isActive]);\n};\n"],"mappings":"AAAA,OAASA,SAAT,KAA0B,OAA1B,CAEA,OAASC,EAAT,uBAEA,MAAO,IAAMC,mBAAkB,CAAGD,EAAE,CAAC,kBAAD,CAA7B,CACP,MAAO,IAAME,oBAAmB,CAAG,sCAA5B,C,GAEDC,YAAW,CAAG,SAACC,CAAD,CAAuBC,CAAvB,CAA6C,CAC/D,MAAOD,EAAO,CAACE,SAAR,CAAkBC,QAAlB,CAA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AGAG,aAAa,EAHb,CAKOE,gBALP,CAMD,CAPQ,CAON,CAACE,CAAD,CAPM,CAQV,CAXM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useHover';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/hooks/useHover/index.ts"],"sourcesContent":["export * from './useHover';\n"],"mappings":"AAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type UseHoverProps = {
|
|
2
|
+
isActive?: boolean | (() => boolean | undefined);
|
|
3
|
+
refs: React.RefObject<HTMLElement>[];
|
|
4
|
+
onHover?: (event: MouseEvent) => void;
|
|
5
|
+
onBlur?: (event: MouseEvent) => void;
|
|
6
|
+
blurDelay?: number;
|
|
7
|
+
hoverDelay?: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const useHover: ({ refs, onHover, onBlur, blurDelay, hoverDelay, isActive, }: UseHoverProps) => void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function _createForOfIteratorHelper(a,b){var c="undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(!c){if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&"number"==typeof a.length){c&&(a=c);var d=0,e=function(){};return{s:e,n:function n(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}},e:function e(a){throw a},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f,g=!0,h=!1;return{s:function s(){c=c.call(a)},n:function n(){var a=c.next();return g=a.done,a},e:function e(a){h=!0,f=a},f:function f(){try{g||null==c["return"]||c["return"]()}finally{if(h)throw f}}}}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}import{useEffect,useRef}from"react";import{useMutableRef}from"../useMutableRef";export var useHover=function(a){var b=a.refs,c=a.onHover,d=a.onBlur,e=a.blurDelay,f=void 0===e?200:e,g=a.hoverDelay,h=void 0===g?0:g,i=a.isActive,j=useRef(null),k=useRef(null),l=useRef(!1),m=useMutableRef([c,d,i,f,h]),n=function(){return"function"==typeof m.current[2]?m.current[2]():m.current[2]},o=function(){k.current&&(clearTimeout(k.current),k.current=null),j.current&&(clearTimeout(j.current),j.current=null)};useEffect(function(){var a,c=function(a){n()&&(o(),k.current=setTimeout(function(){if(!l.current){var b,c;l.current=!0,null===(b=(c=m.current)[0])||void 0===b?void 0:b.call(c,a)}},m.current[4]))},d=function(a){n()&&(o(),j.current=setTimeout(function(){if(l.current){var b,c;l.current=!1,null===(b=(c=m.current)[1])||void 0===b?void 0:b.call(c,a)}},m.current[3]))},e=_createForOfIteratorHelper(b);try{for(e.s();!(a=e.n()).done;){var f,g,h=a.value;null===(f=h.current)||void 0===f?void 0:f.addEventListener("mouseenter",c),null===(g=h.current)||void 0===g?void 0:g.addEventListener("mouseleave",d)}}catch(a){e.e(a)}finally{e.f()}return function(){var a,e=_createForOfIteratorHelper(b);try{for(e.s();!(a=e.n()).done;){var f,g,h=a.value;null===(f=h.current)||void 0===f?void 0:f.removeEventListener("mouseenter",c),null===(g=h.current)||void 0===g?void 0:g.removeEventListener("mouseleave",d)}}catch(a){e.e(a)}finally{e.f()}o()}},[b])};
|
|
2
|
+
//# sourceMappingURL=useHover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHover.js","names":["useEffect","useRef","useMutableRef","useHover","refs","onHover","onBlur","blurDelay","hoverDelay","isActive","blurTimeoutId","hoverTimeoutId","isHovered","mutableRef","getActive","current","clearTimeouts","clearTimeout","handleMouseEnter","event","setTimeout","handleMouseLeave","element","addEventListener","removeEventListener"],"sources":["../../../../../src/hooks/useHover/useHover.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\nimport { useMutableRef } from '##/hooks/useMutableRef';\n\nexport type UseHoverProps = {\n isActive?: boolean | (() => boolean | undefined);\n refs: React.RefObject<HTMLElement>[];\n onHover?: (event: MouseEvent) => void;\n onBlur?: (event: MouseEvent) => void;\n blurDelay?: number;\n hoverDelay?: number;\n};\n\nexport const useHover = ({\n refs,\n onHover,\n onBlur,\n blurDelay = 200,\n hoverDelay = 0,\n isActive,\n}: UseHoverProps): void => {\n const blurTimeoutId = useRef<NodeJS.Timeout | null>(null);\n const hoverTimeoutId = useRef<NodeJS.Timeout | null>(null);\n const isHovered = useRef(false);\n const mutableRef = useMutableRef([\n onHover,\n onBlur,\n isActive,\n blurDelay,\n hoverDelay,\n ] as const);\n\n const getActive = () =>\n typeof mutableRef.current[2] === 'function'\n ? mutableRef.current[2]()\n : mutableRef.current[2];\n\n const clearTimeouts = () => {\n if (hoverTimeoutId.current) {\n clearTimeout(hoverTimeoutId.current);\n hoverTimeoutId.current = null;\n }\n if (blurTimeoutId.current) {\n clearTimeout(blurTimeoutId.current);\n blurTimeoutId.current = null;\n }\n };\n\n useEffect(() => {\n const handleMouseEnter = (event: MouseEvent) => {\n if (!getActive()) {\n return;\n }\n\n clearTimeouts();\n\n hoverTimeoutId.current = setTimeout(() => {\n if (!isHovered.current) {\n isHovered.current = true;\n mutableRef.current[0]?.(event);\n }\n }, mutableRef.current[4]);\n };\n\n const handleMouseLeave = (event: MouseEvent) => {\n if (!getActive()) {\n return;\n }\n\n clearTimeouts();\n\n blurTimeoutId.current = setTimeout(() => {\n if (isHovered.current) {\n isHovered.current = false;\n mutableRef.current[1]?.(event);\n }\n }, mutableRef.current[3]);\n };\n\n for (const element of refs) {\n element.current?.addEventListener('mouseenter', handleMouseEnter);\n element.current?.addEventListener('mouseleave', handleMouseLeave);\n }\n\n return () => {\n for (const element of refs) {\n element.current?.removeEventListener('mouseenter', handleMouseEnter);\n element.current?.removeEventListener('mouseleave', handleMouseLeave);\n }\n clearTimeouts();\n };\n }, [refs]);\n};\n"],"mappings":"qpCAAA,OAASA,SAAT,CAAoBC,MAApB,KAAkC,OAAlC,CAEA,OAASC,aAAT,wBAWA,MAAO,IAAMC,SAAQ,CAAG,WAOG,IANzBC,EAMyB,GANzBA,IAMyB,CALzBC,CAKyB,GALzBA,OAKyB,CAJzBC,CAIyB,GAJzBA,MAIyB,KAHzBC,SAGyB,CAHzBA,CAGyB,YAHb,GAGa,OAFzBC,UAEyB,CAFzBA,CAEyB,YAFZ,CAEY,GADzBC,CACyB,GADzBA,QACyB,CACnBC,CAAa,CAAGT,MAAM,CAAwB,IAAxB,CADH,CAEnBU,CAAc,CAAGV,MAAM,CAAwB,IAAxB,CAFJ,CAGnBW,CAAS,CAAGX,MAAM,IAHC,CAInBY,CAAU,CAAGX,aAAa,CAAC,CAC/BG,CAD+B,CAE/BC,CAF+B,CAG/BG,CAH+B,CAI/BF,CAJ+B,CAK/BC,CAL+B,CAAD,CAJP,CAYnBM,CAAS,CAAG,iBACiB,UAAjC,QAAOD,EAAU,CAACE,OAAX,CAAmB,CAAnB,CAAP,CACIF,CAAU,CAACE,OAAX,CAAmB,CAAnB,GADJ,CAEIF,CAAU,CAACE,OAAX,CAAmB,CAAnB,CAHY,CAZO,CAiBnBC,CAAa,CAAG,UAAM,CACtBL,CAAc,CAACI,OADO,GAExBE,YAAY,CAACN,CAAc,CAACI,OAAhB,CAFY,CAGxBJ,CAAc,CAACI,OAAf,CAAyB,IAHD,EAKtBL,CAAa,CAACK,OALQ,GAMxBE,YAAY,CAACP,CAAa,CAACK,OAAf,CANY,CAOxBL,CAAa,CAACK,OAAd,CAAwB,IAPA,CAS3B,CA1BwB,CA4BzBf,SAAS,CAAC,UAAM,OACRkB,CAAgB,CAAG,SAACC,CAAD,CAAuB,CACzCL,C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,CA/EM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const clearUndefined: <T extends Record<string, unknown>>(obj: T) => T;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";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}export var clearUndefined=function(a){var b=_objectSpread({},a);for(var c in b)void 0===b[c]&&delete b[c];return b};
|
|
2
|
+
//# sourceMappingURL=clearUndefined.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clearUndefined.js","names":["clearUndefined","obj","result","key"],"sources":["../../../../../src/utils/object/clearUndefined.ts"],"sourcesContent":["export const clearUndefined = <T extends Record<string, unknown>>(\n obj: T,\n): T => {\n const result = { ...obj };\n for (const key in result) {\n if (result[key] === undefined) {\n delete result[key];\n }\n }\n return result as T;\n};\n"],"mappings":"qqBAAA,MAAO,IAAMA,eAAc,CAAG,SAC5BC,CAD4B,CAEtB,CACN,GAAMC,EAAM,kBAAQD,CAAR,CAAZ,CACA,IAAK,GAAME,EAAX,GAAkBD,EAAlB,CACM,SAAAA,CAAM,CAACC,CAAD,CADZ,EAEI,MAAOD,EAAM,CAACC,CAAD,CAFjB,CAKA,MAAOD,EACR,CAVM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./isEmpty";export*from"./isEq";export*from"./objectWithDefault";export*from"./pick";
|
|
1
|
+
export*from"./isEmpty";export*from"./isEq";export*from"./objectWithDefault";export*from"./pick";export*from"./clearUndefined";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/utils/object/index.ts"],"sourcesContent":["export * from './isEmpty';\nexport * from './isEq';\nexport * from './objectWithDefault';\nexport * from './pick';\n"],"mappings":"AAAA,uBACA,oBACA,iCACA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/utils/object/index.ts"],"sourcesContent":["export * from './isEmpty';\nexport * from './isEq';\nexport * from './objectWithDefault';\nexport * from './pick';\nexport * from './clearUndefined';\n"],"mappings":"AAAA,uBACA,oBACA,iCACA,oBACA"}
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../__internal__/src/hooks/useBodyScrollFreeze";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../__internal__/src/hooks/useBodyScrollFreeze";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../__internal__/src/hooks/useHover";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../__internal__/src/hooks/useHover";
|