@consta/uikit 4.17.1 → 4.18.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/README.md +30 -2
- package/__internal__/src/components/Avatar/Avatar.css +1 -1
- package/__internal__/src/components/Badge/Badge.css +1 -1
- package/__internal__/src/components/Badge/Badge.d.ts +5 -0
- package/__internal__/src/components/Badge/Badge.js +1 -1
- package/__internal__/src/components/Badge/Badge.js.map +1 -1
- package/__internal__/src/components/Breadcrumbs/BreadcrumbsMore/BreadcrumbsMore.js +1 -1
- package/__internal__/src/components/Breadcrumbs/BreadcrumbsMore/BreadcrumbsMore.js.map +1 -1
- package/__internal__/src/components/Breadcrumbs/helpers.d.ts +2 -2
- package/__internal__/src/components/Breadcrumbs/helpers.js +1 -1
- package/__internal__/src/components/Breadcrumbs/helpers.js.map +1 -1
- package/__internal__/src/components/Checkbox/Checkbox.css +2 -2
- package/__internal__/src/components/CheckboxGroup/CheckboxGroup.js +1 -1
- package/__internal__/src/components/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/__internal__/src/components/CheckboxGroup/helper.d.ts +2 -1
- package/__internal__/src/components/CheckboxGroup/helper.js +1 -1
- package/__internal__/src/components/CheckboxGroup/helper.js.map +1 -1
- package/__internal__/src/components/CheckboxGroup/types.d.ts +3 -0
- package/__internal__/src/components/CheckboxGroup/types.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeDate/DateTimeTypeDate.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeDate/DateTimeTypeDate.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeMonth/DateTimeTypeMonth.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeMonth/DateTimeTypeMonth.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeYear/DateTimeTypeYear.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeYear/DateTimeTypeYear.js.map +1 -1
- package/__internal__/src/components/DragNDropField/DragNDropFieldTooltip/DragNDropFieldTooltip.css +1 -1
- package/__internal__/src/components/DragNDropField/DragNDropFieldTooltip/DragNDropFieldTooltip.js +1 -1
- package/__internal__/src/components/DragNDropField/DragNDropFieldTooltip/DragNDropFieldTooltip.js.map +1 -1
- package/__internal__/src/components/File/File.css +1 -1
- package/__internal__/src/components/Informer/Informer.d.ts +1 -1
- package/__internal__/src/components/Informer/Informer.js +1 -1
- package/__internal__/src/components/Informer/Informer.js.map +1 -1
- package/__internal__/src/components/ListCanary/ListDivider/ListDivider.js +1 -1
- package/__internal__/src/components/ListCanary/ListDivider/ListDivider.js.map +1 -1
- package/__internal__/src/components/ListCanary/maps.d.ts +1 -0
- package/__internal__/src/components/ListCanary/maps.js +1 -1
- package/__internal__/src/components/ListCanary/maps.js.map +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.css +9 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.js +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.js.map +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarLine/ProgressStepBarLine.js +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarLine/ProgressStepBarLine.js.map +1 -1
- package/__internal__/src/components/RadioGroup/RadioGroup.css +1 -1
- package/__internal__/src/components/RadioGroup/RadioGroup.js +1 -1
- package/__internal__/src/components/RadioGroup/RadioGroup.js.map +1 -1
- package/__internal__/src/components/RadioGroup/helper.d.ts +2 -1
- package/__internal__/src/components/RadioGroup/helper.js +1 -1
- package/__internal__/src/components/RadioGroup/helper.js.map +1 -1
- package/__internal__/src/components/RadioGroup/types.d.ts +3 -0
- package/__internal__/src/components/RadioGroup/types.js.map +1 -1
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js +1 -1
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js.map +1 -1
- package/__internal__/src/components/TabsDeprecated/Tab/TabsTab.css +1 -1
- package/__internal__/src/components/TabsDeprecated/Tab/TabsTab.js +1 -1
- package/__internal__/src/components/TabsDeprecated/Tab/TabsTab.js.map +1 -1
- package/__internal__/src/components/User/User.css +1 -1
- package/__internal__/src/components/User/User.js +1 -1
- package/__internal__/src/components/User/User.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["minDate","maxDate","value","onChange","onChangeRange","disableDates","currentVisibleDate","events","locale","className","view","onMove","onChangeCurrentVisibleDate"];import{addYears,startOfDecade}from"date-fns";import ruLocale from"date-fns/locale/ru";import React,{forwardRef,useEffect}from"react";import{DateTime10Years}from"../DateTime10Years/DateTime10Years";import{DateTime100YearSlider}from"../DateTime100YearSlider/DateTime100YearSlider";import{DateTimeLabel}from"../DateTimeLabel/DateTimeLabel";import{DateTimeToggler}from"../DateTimeToggler/DateTimeToggler";import{getDecadeTitle,getHandleSelectDate,getYearsOfDecade,isEqualYear,moveTypes,useCurrentVisibleDate}from"../helpers";import{dateTimePropView,dateTimePropViewDefault}from"../helpers/types";import{cnDateTimeMixLayout}from"../mixs";export var DateTimeTypeYear=forwardRef(function(a,b){var c=a.minDate,d=a.maxDate,e=a.value,f=a.onChange,g=a.onChangeRange,h=a.disableDates,i=a.currentVisibleDate,j=a.events,k=a.locale,l=void 0===k?ruLocale:k,m=a.className,n=a.view,o=void 0===n?dateTimePropViewDefault:n,p=a.onMove,q=a.onChangeCurrentVisibleDate,r=_objectWithoutProperties(a,_excluded);useEffect(function(){null===p||void 0===p?void 0:p(moveTypes[0])},[]);var
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["minDate","maxDate","value","onChange","onChangeRange","disableDates","currentVisibleDate","events","locale","className","view","onMove","onChangeCurrentVisibleDate","multiplicityHours","multiplicityMinutes","multiplicitySeconds"];import{addYears,startOfDecade}from"date-fns";import ruLocale from"date-fns/locale/ru";import React,{forwardRef,useEffect}from"react";import{DateTime10Years}from"../DateTime10Years/DateTime10Years";import{DateTime100YearSlider}from"../DateTime100YearSlider/DateTime100YearSlider";import{DateTimeLabel}from"../DateTimeLabel/DateTimeLabel";import{DateTimeToggler}from"../DateTimeToggler/DateTimeToggler";import{getDecadeTitle,getHandleSelectDate,getYearsOfDecade,isEqualYear,moveTypes,useCurrentVisibleDate}from"../helpers";import{dateTimePropView,dateTimePropViewDefault}from"../helpers/types";import{cnDateTimeMixLayout}from"../mixs";export var DateTimeTypeYear=forwardRef(function(a,b){var c=a.minDate,d=a.maxDate,e=a.value,f=a.onChange,g=a.onChangeRange,h=a.disableDates,i=a.currentVisibleDate,j=a.events,k=a.locale,l=void 0===k?ruLocale:k,m=a.className,n=a.view,o=void 0===n?dateTimePropViewDefault:n,p=a.onMove,q=a.onChangeCurrentVisibleDate,r=a.multiplicityHours,s=a.multiplicityMinutes,t=a.multiplicitySeconds,u=_objectWithoutProperties(a,_excluded);useEffect(function(){null===p||void 0===p?void 0:p(moveTypes[0])},[]);var v=useCurrentVisibleDate({currentVisibleDate:i,maxDate:d,minDate:c,value:e,startOfUnit:startOfDecade,onChangeCurrentVisibleDate:q}),w=_slicedToArray(v,2),x=w[0],y=w[1],z=getHandleSelectDate({minDate:c,maxDate:d,value:e,onChange:f,onChangeRange:g,isEqualUnit:isEqualYear}),A=getYearsOfDecade({date:x,onChange:z,value:e,disableDates:h,events:j,minDate:c,maxDate:d,locale:l}),B=getDecadeTitle(x),C=function(){return y(addYears(x,10))},D=function(){return y(addYears(x,-10))};if(o===dateTimePropView[0])return React.createElement("div",Object.assign({},u,{className:cnDateTimeMixLayout({view:o},[m]),ref:b}),React.createElement(DateTimeToggler,{className:cnDateTimeMixLayout("Label"),prevOnClick:D,nextOnClick:C,label:B}),React.createElement(DateTime10Years,{years:A}));var E=addYears(x,10),F=getYearsOfDecade({date:E,onChange:z,value:e,events:j,minDate:c,maxDate:d,locale:l}),G=getDecadeTitle(E);return o===dateTimePropView[1]?React.createElement("div",Object.assign({},u,{className:cnDateTimeMixLayout({view:o},[m]),ref:b}),React.createElement("div",{className:cnDateTimeMixLayout("Page")},React.createElement(DateTimeToggler,{className:cnDateTimeMixLayout("Label"),prevOnClick:D,label:B}),React.createElement(DateTime10Years,{years:A})),React.createElement("div",{className:cnDateTimeMixLayout("Page")},React.createElement(DateTimeToggler,{className:cnDateTimeMixLayout("Label"),nextOnClick:C,label:G}),React.createElement(DateTime10Years,{years:F}))):React.createElement("div",Object.assign({},u,{className:cnDateTimeMixLayout({view:o},[m]),ref:b}),React.createElement(DateTime100YearSlider,{className:cnDateTimeMixLayout("Slider"),currentVisibleDate:x,onChange:y,value:e,locale:l}),React.createElement("div",{className:cnDateTimeMixLayout("PageWrapper")},React.createElement("div",{className:cnDateTimeMixLayout("Page")},React.createElement(DateTimeLabel,{className:cnDateTimeMixLayout("Label"),label:B}),React.createElement(DateTime10Years,{years:A})),React.createElement("div",{className:cnDateTimeMixLayout("Page")},React.createElement(DateTimeLabel,{className:cnDateTimeMixLayout("Label"),label:G}),React.createElement(DateTime10Years,{years:F}))))});
|
|
2
2
|
//# sourceMappingURL=DateTimeTypeYear.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeTypeYear.js","names":["addYears","startOfDecade","ruLocale","React","forwardRef","useEffect","DateTime10Years","DateTime100YearSlider","DateTimeLabel","DateTimeToggler","getDecadeTitle","getHandleSelectDate","getYearsOfDecade","isEqualYear","moveTypes","useCurrentVisibleDate","dateTimePropView","dateTimePropViewDefault","cnDateTimeMixLayout","DateTimeTypeYear","props","ref","minDate","maxDate","value","onChange","onChangeRange","disableDates","currentVisibleDateProp","currentVisibleDate","events","locale","className","view","onMove","onChangeCurrentVisibleDate","otherProps","startOfUnit","setCurrentVisibleDate","handleSelectDate","isEqualUnit","pageOneYearsOfDecade","date","pageOneLabel","handleNext","handlePrev","pageTwoCurrentVisibleDate","pageTwoYearsOfDecade","pageTwoLabel"],"sources":["../../../../../../src/components/DateTime/DateTimeTypeYear/DateTimeTypeYear.tsx"],"sourcesContent":["import { addYears, startOfDecade } from 'date-fns';\nimport ruLocale from 'date-fns/locale/ru';\nimport React, { forwardRef, useEffect } from 'react';\n\nimport { DateTime10Years } from '../DateTime10Years/DateTime10Years';\nimport { DateTime100YearSlider } from '../DateTime100YearSlider/DateTime100YearSlider';\nimport { DateTimeLabel } from '../DateTimeLabel/DateTimeLabel';\nimport { DateTimeToggler } from '../DateTimeToggler/DateTimeToggler';\nimport {\n DateTimeTypeComponent,\n getDecadeTitle,\n getHandleSelectDate,\n getYearsOfDecade,\n isEqualYear,\n moveTypes,\n useCurrentVisibleDate,\n} from '../helpers';\nimport { dateTimePropView, dateTimePropViewDefault } from '../helpers/types';\nimport { cnDateTimeMixLayout } from '../mixs';\n\nexport const DateTimeTypeYear: DateTimeTypeComponent<'year'> = forwardRef(\n (props, ref) => {\n const {\n minDate,\n maxDate,\n value,\n onChange,\n onChangeRange,\n disableDates,\n currentVisibleDate: currentVisibleDateProp,\n events,\n locale = ruLocale,\n className,\n view = dateTimePropViewDefault,\n onMove,\n onChangeCurrentVisibleDate,\n
|
|
1
|
+
{"version":3,"file":"DateTimeTypeYear.js","names":["addYears","startOfDecade","ruLocale","React","forwardRef","useEffect","DateTime10Years","DateTime100YearSlider","DateTimeLabel","DateTimeToggler","getDecadeTitle","getHandleSelectDate","getYearsOfDecade","isEqualYear","moveTypes","useCurrentVisibleDate","dateTimePropView","dateTimePropViewDefault","cnDateTimeMixLayout","DateTimeTypeYear","props","ref","minDate","maxDate","value","onChange","onChangeRange","disableDates","currentVisibleDateProp","currentVisibleDate","events","locale","className","view","onMove","onChangeCurrentVisibleDate","multiplicityHours","multiplicityMinutes","multiplicitySeconds","otherProps","startOfUnit","setCurrentVisibleDate","handleSelectDate","isEqualUnit","pageOneYearsOfDecade","date","pageOneLabel","handleNext","handlePrev","pageTwoCurrentVisibleDate","pageTwoYearsOfDecade","pageTwoLabel"],"sources":["../../../../../../src/components/DateTime/DateTimeTypeYear/DateTimeTypeYear.tsx"],"sourcesContent":["import { addYears, startOfDecade } from 'date-fns';\nimport ruLocale from 'date-fns/locale/ru';\nimport React, { forwardRef, useEffect } from 'react';\n\nimport { DateTime10Years } from '../DateTime10Years/DateTime10Years';\nimport { DateTime100YearSlider } from '../DateTime100YearSlider/DateTime100YearSlider';\nimport { DateTimeLabel } from '../DateTimeLabel/DateTimeLabel';\nimport { DateTimeToggler } from '../DateTimeToggler/DateTimeToggler';\nimport {\n DateTimeTypeComponent,\n getDecadeTitle,\n getHandleSelectDate,\n getYearsOfDecade,\n isEqualYear,\n moveTypes,\n useCurrentVisibleDate,\n} from '../helpers';\nimport { dateTimePropView, dateTimePropViewDefault } from '../helpers/types';\nimport { cnDateTimeMixLayout } from '../mixs';\n\nexport const DateTimeTypeYear: DateTimeTypeComponent<'year'> = forwardRef(\n (props, ref) => {\n const {\n minDate,\n maxDate,\n value,\n onChange,\n onChangeRange,\n disableDates,\n currentVisibleDate: currentVisibleDateProp,\n events,\n locale = ruLocale,\n className,\n view = dateTimePropViewDefault,\n onMove,\n onChangeCurrentVisibleDate,\n multiplicityHours,\n multiplicityMinutes,\n multiplicitySeconds,\n ...otherProps\n } = props;\n\n useEffect(() => {\n onMove?.(moveTypes[0]);\n }, []);\n\n const [currentVisibleDate, setCurrentVisibleDate] = useCurrentVisibleDate({\n currentVisibleDate: currentVisibleDateProp,\n maxDate,\n minDate,\n value,\n startOfUnit: startOfDecade,\n onChangeCurrentVisibleDate,\n });\n\n const handleSelectDate = getHandleSelectDate({\n minDate,\n maxDate,\n value,\n onChange,\n onChangeRange,\n isEqualUnit: isEqualYear,\n });\n\n const pageOneYearsOfDecade = getYearsOfDecade({\n date: currentVisibleDate,\n onChange: handleSelectDate,\n value,\n disableDates,\n events,\n minDate,\n maxDate,\n locale,\n });\n\n const pageOneLabel = getDecadeTitle(currentVisibleDate);\n\n const handleNext = () =>\n setCurrentVisibleDate(addYears(currentVisibleDate, 10));\n const handlePrev = () =>\n setCurrentVisibleDate(addYears(currentVisibleDate, -10));\n\n if (view === dateTimePropView[0]) {\n return (\n <div\n {...otherProps}\n className={cnDateTimeMixLayout({ view }, [className])}\n ref={ref}\n >\n <DateTimeToggler\n className={cnDateTimeMixLayout('Label')}\n prevOnClick={handlePrev}\n nextOnClick={handleNext}\n label={pageOneLabel}\n />\n <DateTime10Years years={pageOneYearsOfDecade} />\n </div>\n );\n }\n\n const pageTwoCurrentVisibleDate = addYears(currentVisibleDate, 10);\n\n const pageTwoYearsOfDecade = getYearsOfDecade({\n date: pageTwoCurrentVisibleDate,\n onChange: handleSelectDate,\n value,\n events,\n minDate,\n maxDate,\n locale,\n });\n\n const pageTwoLabel = getDecadeTitle(pageTwoCurrentVisibleDate);\n\n if (view === dateTimePropView[1]) {\n return (\n <div\n {...otherProps}\n className={cnDateTimeMixLayout({ view }, [className])}\n ref={ref}\n >\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeToggler\n className={cnDateTimeMixLayout('Label')}\n prevOnClick={handlePrev}\n label={pageOneLabel}\n />\n <DateTime10Years years={pageOneYearsOfDecade} />\n </div>\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeToggler\n className={cnDateTimeMixLayout('Label')}\n nextOnClick={handleNext}\n label={pageTwoLabel}\n />\n <DateTime10Years years={pageTwoYearsOfDecade} />\n </div>\n </div>\n );\n }\n\n return (\n <div\n {...otherProps}\n className={cnDateTimeMixLayout({ view }, [className])}\n ref={ref}\n >\n <DateTime100YearSlider\n className={cnDateTimeMixLayout('Slider')}\n currentVisibleDate={currentVisibleDate}\n onChange={setCurrentVisibleDate}\n value={value}\n locale={locale}\n />\n <div className={cnDateTimeMixLayout('PageWrapper')}>\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeLabel\n className={cnDateTimeMixLayout('Label')}\n label={pageOneLabel}\n />\n <DateTime10Years years={pageOneYearsOfDecade} />\n </div>\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeLabel\n className={cnDateTimeMixLayout('Label')}\n label={pageTwoLabel}\n />\n <DateTime10Years years={pageTwoYearsOfDecade} />\n </div>\n </div>\n </div>\n );\n },\n);\n"],"mappings":"4YAAA,OAASA,QAAT,CAAmBC,aAAnB,KAAwC,UAAxC,CACA,MAAOC,SAAP,KAAqB,oBAArB,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,SAA5B,KAA6C,OAA7C,CAEA,OAASC,eAAT,0CACA,OAASC,qBAAT,sDACA,OAASC,aAAT,sCACA,OAASC,eAAT,0CACA,OAEEC,cAFF,CAGEC,mBAHF,CAIEC,gBAJF,CAKEC,WALF,CAMEC,SANF,CAOEC,qBAPF,kBASA,OAASC,gBAAT,CAA2BC,uBAA3B,wBACA,OAASC,mBAAT,eAEA,MAAO,IAAMC,iBAA+C,CAAGf,UAAU,CACvE,SAACgB,CAAD,CAAQC,CAAR,CAAgB,CACd,GACEC,EADF,CAkBIF,CAlBJ,CACEE,OADF,CAEEC,CAFF,CAkBIH,CAlBJ,CAEEG,OAFF,CAGEC,CAHF,CAkBIJ,CAlBJ,CAGEI,KAHF,CAIEC,CAJF,CAkBIL,CAlBJ,CAIEK,QAJF,CAKEC,CALF,CAkBIN,CAlBJ,CAKEM,aALF,CAMEC,CANF,CAkBIP,CAlBJ,CAMEO,YANF,CAOsBC,CAPtB,CAkBIR,CAlBJ,CAOES,kBAPF,CAQEC,CARF,CAkBIV,CAlBJ,CAQEU,MARF,GAkBIV,CAlBJ,CASEW,MATF,CASEA,CATF,YASW7B,QATX,GAUE8B,CAVF,CAkBIZ,CAlBJ,CAUEY,SAVF,GAkBIZ,CAlBJ,CAWEa,IAXF,CAWEA,CAXF,YAWShB,uBAXT,GAYEiB,CAZF,CAkBId,CAlBJ,CAYEc,MAZF,CAaEC,CAbF,CAkBIf,CAl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
1
|
-
.DragNDropFieldTooltip-
|
|
1
|
+
.DragNDropFieldTooltip-Text{word-break:break-word}
|
package/__internal__/src/components/DragNDropField/DragNDropFieldTooltip/DragNDropFieldTooltip.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"./DragNDropFieldTooltip.css";import React from"react";import{cn}from"../../../utils/bem";import{Text}from"../../Text/Text";import{Tooltip}from"../../Tooltip/Tooltip";var cnDragNDropFieldTooltip=cn("DragNDropFieldTooltip");export var DragNDropFieldTooltip=function(a){var b=a.anchorRef,c=a.errors,d=React.useState(!1),e=_slicedToArray(d,2),f=e[0],g=e[1];return React.useEffect(function(){g(!1)},[c]),f||0===c.length?null:React.createElement(Tooltip,{anchorRef:b,status:"alert",size:"l",isInteractive:!1,onClickOutside:function onClickOutside(){return g(!0)}},React.createElement(Text,{size:"s"},1===c.length?c[0]:React.createElement("ul",{className:cnDragNDropFieldTooltip("List")},c.map(function(a){return React.createElement("li",{key:a},a)}))))};
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"./DragNDropFieldTooltip.css";import React from"react";import{cnMixSpace}from"../../../mixs/MixSpace";import{cn}from"../../../utils/bem";import{Text}from"../../Text/Text";import{Tooltip}from"../../Tooltip/Tooltip";var cnDragNDropFieldTooltip=cn("DragNDropFieldTooltip");export var DragNDropFieldTooltip=function(a){var b=a.anchorRef,c=a.errors,d=React.useState(!1),e=_slicedToArray(d,2),f=e[0],g=e[1];return React.useEffect(function(){g(!1)},[c]),f||0===c.length?null:React.createElement(Tooltip,{anchorRef:b,status:"alert",size:"l",isInteractive:!1,onClickOutside:function onClickOutside(){return g(!0)}},React.createElement(Text,{size:"s",className:cnDragNDropFieldTooltip("Text")},1===c.length?c[0]:React.createElement("ul",{className:cnDragNDropFieldTooltip("List",[cnMixSpace({pL:"xl"})])},c.map(function(a){return React.createElement("li",{key:a},a)}))))};
|
|
2
2
|
//# sourceMappingURL=DragNDropFieldTooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragNDropFieldTooltip.js","names":["React","cn","Text","Tooltip","cnDragNDropFieldTooltip","DragNDropFieldTooltip","anchorRef","errors","useState","isHidden","setIsHidden","useEffect","length","map","error"],"sources":["../../../../../../src/components/DragNDropField/DragNDropFieldTooltip/DragNDropFieldTooltip.tsx"],"sourcesContent":["import './DragNDropFieldTooltip.css';\n\nimport React from 'react';\n\nimport { cn } from '../../../utils/bem';\nimport { Text } from '../../Text/Text';\nimport { Tooltip } from '../../Tooltip/Tooltip';\n\ntype DragNDropFieldTooltipProps = {\n anchorRef: React.RefObject<HTMLElement>;\n errors: string[];\n};\n\nconst cnDragNDropFieldTooltip = cn('DragNDropFieldTooltip');\n\nexport const DragNDropFieldTooltip: React.FC<DragNDropFieldTooltipProps> = ({\n anchorRef,\n errors,\n}) => {\n const [isHidden, setIsHidden] = React.useState(false);\n\n React.useEffect(() => {\n setIsHidden(false);\n }, [errors]);\n\n return isHidden || errors.length === 0 ? null : (\n <Tooltip\n anchorRef={anchorRef}\n status=\"alert\"\n size=\"l\"\n isInteractive={false}\n onClickOutside={() => setIsHidden(true)}\n >\n <Text size=\"s\">\n {errors.length === 1 ? (\n errors[0]\n ) : (\n <ul
|
|
1
|
+
{"version":3,"file":"DragNDropFieldTooltip.js","names":["React","cnMixSpace","cn","Text","Tooltip","cnDragNDropFieldTooltip","DragNDropFieldTooltip","anchorRef","errors","useState","isHidden","setIsHidden","useEffect","length","pL","map","error"],"sources":["../../../../../../src/components/DragNDropField/DragNDropFieldTooltip/DragNDropFieldTooltip.tsx"],"sourcesContent":["import './DragNDropFieldTooltip.css';\n\nimport React from 'react';\n\nimport { cnMixSpace } from '##/mixs/MixSpace';\n\nimport { cn } from '../../../utils/bem';\nimport { Text } from '../../Text/Text';\nimport { Tooltip } from '../../Tooltip/Tooltip';\n\ntype DragNDropFieldTooltipProps = {\n anchorRef: React.RefObject<HTMLElement>;\n errors: string[];\n};\n\nconst cnDragNDropFieldTooltip = cn('DragNDropFieldTooltip');\n\nexport const DragNDropFieldTooltip: React.FC<DragNDropFieldTooltipProps> = ({\n anchorRef,\n errors,\n}) => {\n const [isHidden, setIsHidden] = React.useState(false);\n\n React.useEffect(() => {\n setIsHidden(false);\n }, [errors]);\n\n return isHidden || errors.length === 0 ? null : (\n <Tooltip\n anchorRef={anchorRef}\n status=\"alert\"\n size=\"l\"\n isInteractive={false}\n onClickOutside={() => setIsHidden(true)}\n >\n <Text size=\"s\" className={cnDragNDropFieldTooltip('Text')}>\n {errors.length === 1 ? (\n errors[0]\n ) : (\n <ul\n className={cnDragNDropFieldTooltip('List', [\n cnMixSpace({ pL: 'xl' }),\n ])}\n >\n {errors.map((error) => (\n <li key={error}>{error}</li>\n ))}\n </ul>\n )}\n </Text>\n </Tooltip>\n );\n};\n"],"mappings":"iEAAA,oCAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,UAAT,8BAEA,OAASC,EAAT,0BACA,OAASC,IAAT,uBACA,OAASC,OAAT,6BAOA,GAAMC,wBAAuB,CAAGH,EAAE,CAAC,uBAAD,CAAlC,CAEA,MAAO,IAAMI,sBAA2D,CAAG,WAGrE,IAFJC,EAEI,GAFJA,SAEI,CADJC,CACI,GADJA,MACI,GAC4BR,KAAK,CAACS,QAAN,IAD5B,uBACGC,CADH,MACaC,CADb,MAOJ,MAJAX,MAAK,CAACY,SAAN,CAAgB,UAAM,CACpBD,CAAW,IACZ,CAFD,CAEG,CAACH,CAAD,CAFH,CAIA,CAAOE,CAAQ,EAAsB,CAAlB,GAAAF,CAAM,CAACK,MAAnB,CAAkC,IAAlC,CACL,oBAAC,OAAD,EACE,SAAS,CAAEN,CADb,CAEE,MAAM,CAAC,OAFT,CAGE,IAAI,CAAC,GAHP,CAIE,aAAa,GAJf,CAKE,cAAc,CAAE,gCAAMI,EAAW,IAAjB,CALlB,EAOE,oBAAC,IAAD,EAAM,IAAI,CAAC,GAAX,CAAe,SAAS,CAAEN,uBAAuB,CAAC,MAAD,CAAjD,EACqB,CAAlB,GAAAG,CAAM,CAACK,MAAP,CACCL,CAAM,CAAC,CAAD,CADP,CAGC,0BACE,SAAS,CAAEH,uBAAuB,CAAC,MAAD,CAAS,CACzCJ,UAAU,CAAC,CAAEa,EAAE,CAAE,IAAN,CAAD,CAD+B,CAAT,CADpC,EAKGN,CAAM,CAACO,GAAP,CAAW,SAACC,CAAD,QACV,2BAAI,GAAG,CAAEA,CAAT,EAAiBA,CAAjB,CADU,CAAX,CALH,CAJJ,CAPF,CAwBH,CAnCM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.File{position:relative}.File-Loader{align-items:center;background-color:var(--color-control-bg-ghost);border-radius:50%;display:flex;height:var(--
|
|
1
|
+
.File{position:relative}.File-Loader{align-items:center;background-color:var(--color-control-bg-ghost);border-radius:50%;display:flex;height:var(--space-m);justify-content:center;position:absolute;width:var(--space-m)}.File-Progress{color:#575b5e;display:block}
|
|
@@ -5,7 +5,7 @@ import { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttribut
|
|
|
5
5
|
export declare const informerPropView: readonly ["filled", "bordered"];
|
|
6
6
|
export declare type InformerPropView = typeof informerPropView[number];
|
|
7
7
|
export declare const informerPropViewDefault: InformerPropView;
|
|
8
|
-
export declare const informerPropStatus: readonly ["success", "system", "alert", "
|
|
8
|
+
export declare const informerPropStatus: readonly ["success", "system", "alert", "warning"];
|
|
9
9
|
export declare type InformerPropStatus = typeof informerPropStatus[number];
|
|
10
10
|
export declare const informerPropStatusDefault: InformerPropStatus;
|
|
11
11
|
export declare const informerPropSize: readonly ["m", "s"];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["view","status","size","icon","label","title","children"];import"./Informer.css";import{classnames}from"@bem-react/classnames";import React from"react";import{cn}from"../../utils/bem";import{Text}from"../Text/Text";import{useTheme}from"../Theme/Theme";export var informerPropView=["filled","bordered"];export var informerPropViewDefault=informerPropView[0];export var informerPropStatus=["success","system","alert","
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["view","status","size","icon","label","title","children"];import"./Informer.css";import{classnames}from"@bem-react/classnames";import React from"react";import{cnMixSpace}from"../../mixs/MixSpace";import{cn}from"../../utils/bem";import{Text}from"../Text/Text";import{useTheme}from"../Theme/Theme";export var informerPropView=["filled","bordered"];export var informerPropViewDefault=informerPropView[0];export var informerPropStatus=["success","system","alert","warning"];export var informerPropStatusDefault=informerPropStatus[0];export var informerPropSize=["m","s"];export var informerPropSiseDefault=informerPropSize[0];export var cnInformer=cn("Informer");export var Informer=React.forwardRef(function(a,b){var c=a.view,d=void 0===c?informerPropViewDefault:c,e=a.status,f=void 0===e?informerPropStatusDefault:e,g=a.size,h=void 0===g?informerPropSiseDefault:g,i=a.icon,j=a.label,k=a.title,l=a.children,m=_objectWithoutProperties(a,_excluded),n=i,o=useTheme(),p=o.themeClassNames,q="system"!==f&&"filled"===d?classnames(a.className,p.color.accent):a.className;return React.createElement("div",Object.assign({},m,{className:cnInformer({view:d,status:f,withIcon:!!i},[q,cnMixSpace({p:h})]),ref:b}),n&&React.createElement(n,{className:cnInformer("Icon"),size:"s"}),React.createElement("div",{className:cnInformer("Content")},k&&React.createElement(Text,{lineHeight:"xs",className:cnInformer("Title",[cnMixSpace({mB:"2xs"})]),weight:"bold",size:h},k),j?React.createElement(Text,{lineHeight:"xs",className:cnInformer("Label"),size:h},j):l))});
|
|
2
2
|
//# sourceMappingURL=Informer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Informer.js","names":["classnames","React","cn","Text","useTheme","informerPropView","informerPropViewDefault","informerPropStatus","informerPropStatusDefault","informerPropSize","informerPropSiseDefault","cnInformer","Informer","forwardRef","props","ref","view","status","size","icon","label","title","children","otherProps","Icon","themeClassNames","className","color","accent","withIcon"],"sources":["../../../../../src/components/Informer/Informer.tsx"],"sourcesContent":["import './Informer.css';\n\nimport { classnames } from '@bem-react/classnames';\nimport { IconComponent } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { cn } from '../../utils/bem';\nimport { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';\nimport { Text } from '../Text/Text';\nimport { useTheme } from '../Theme/Theme';\n\nexport const informerPropView = ['filled', 'bordered'] as const;\nexport type InformerPropView = typeof informerPropView[number];\nexport const informerPropViewDefault: InformerPropView = informerPropView[0];\n\nexport const informerPropStatus = [\n 'success',\n 'system',\n 'alert',\n '
|
|
1
|
+
{"version":3,"file":"Informer.js","names":["classnames","React","cnMixSpace","cn","Text","useTheme","informerPropView","informerPropViewDefault","informerPropStatus","informerPropStatusDefault","informerPropSize","informerPropSiseDefault","cnInformer","Informer","forwardRef","props","ref","view","status","size","icon","label","title","children","otherProps","Icon","themeClassNames","className","color","accent","withIcon","p","mB"],"sources":["../../../../../src/components/Informer/Informer.tsx"],"sourcesContent":["import './Informer.css';\n\nimport { classnames } from '@bem-react/classnames';\nimport { IconComponent } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { cnMixSpace } from '##/mixs/MixSpace';\n\nimport { cn } from '../../utils/bem';\nimport { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';\nimport { Text } from '../Text/Text';\nimport { useTheme } from '../Theme/Theme';\n\nexport const informerPropView = ['filled', 'bordered'] as const;\nexport type InformerPropView = typeof informerPropView[number];\nexport const informerPropViewDefault: InformerPropView = informerPropView[0];\n\nexport const informerPropStatus = [\n 'success',\n 'system',\n 'alert',\n 'warning',\n] as const;\nexport type InformerPropStatus = typeof informerPropStatus[number];\nexport const informerPropStatusDefault: InformerPropStatus =\n informerPropStatus[0];\n\nexport const informerPropSize = ['m', 's'] as const;\nexport type InformerPropSize = typeof informerPropSize[number];\nexport const informerPropSiseDefault: InformerPropSize = informerPropSize[0];\n\ntype Props = {\n view?: InformerPropView;\n status?: InformerPropStatus;\n icon?: IconComponent;\n label?: React.ReactNode;\n title?: string;\n size?: InformerPropSize;\n};\n\nexport type InformerProps = PropsWithHTMLAttributes<Props, HTMLDivElement>;\n\nexport const cnInformer = cn('Informer');\n\nexport const Informer = React.forwardRef<HTMLDivElement, InformerProps>(\n (props, ref) => {\n const {\n view = informerPropViewDefault,\n status = informerPropStatusDefault,\n size = informerPropSiseDefault,\n icon,\n label,\n title,\n children,\n ...otherProps\n } = props;\n const Icon = icon;\n const withIcon = !!icon;\n const { themeClassNames } = useTheme();\n const className =\n status !== 'system' && view === 'filled'\n ? classnames(props.className, themeClassNames.color.accent)\n : props.className;\n\n return (\n <div\n {...otherProps}\n className={cnInformer(\n {\n view,\n status,\n withIcon,\n },\n [className, cnMixSpace({ p: size })],\n )}\n ref={ref}\n >\n {Icon && <Icon className={cnInformer('Icon')} size=\"s\" />}\n <div className={cnInformer('Content')}>\n {title && (\n <Text\n lineHeight=\"xs\"\n className={cnInformer('Title', [cnMixSpace({ mB: '2xs' })])}\n weight=\"bold\"\n size={size}\n >\n {title}\n </Text>\n )}\n {label ? (\n <Text lineHeight=\"xs\" className={cnInformer('Label')} size={size}>\n {label}\n </Text>\n ) : (\n children\n )}\n </div>\n </div>\n );\n },\n);\n"],"mappings":"8JAAA,uBAEA,OAASA,UAAT,KAA2B,uBAA3B,CAEA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,UAAT,2BAEA,OAASC,EAAT,uBAEA,OAASC,IAAT,oBACA,OAASC,QAAT,sBAEA,MAAO,IAAMC,iBAAgB,CAAG,CAAC,QAAD,CAAW,UAAX,CAAzB,CAEP,MAAO,IAAMC,wBAAyC,CAAGD,gBAAgB,CAAC,CAAD,CAAlE,CAEP,MAAO,IAAME,mBAAkB,CAAG,CAChC,SADgC,CAEhC,QAFgC,CAGhC,OAHgC,CAIhC,SAJgC,CAA3B,CAOP,MAAO,IAAMC,0BAA6C,CACxDD,kBAAkB,CAAC,CAAD,CADb,CAGP,MAAO,IAA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,2BAAK,SAAS,CAAEA,UAAU,CAAC,SAAD,CAA1B,EACGU,CAAK,EACJ,oBAAC,IAAD,EACE,UAAU,CAAC,IADb,CAEE,SAAS,CAAEV,UAAU,CAAC,OAAD,CAAU,CAACV,UAAU,CAAC,CAAE8B,EAAE,CAAE,KAAN,CAAD,CAAX,CAAV,CAFvB,CAGE,MAAM,CAAC,MAHT,CAIE,IAAI,CAAEb,CAJR,EAMGG,CANH,CAFJ,CAWGD,CAAK,CACJ,oBAAC,IAAD,EAAM,UAAU,CAAC,IAAjB,CAAsB,SAAS,CAAET,UAAU,CAAC,OAAD,CAA3C,CAAsD,IAAI,CAAEO,CAA5D,EACGE,CADH,CADI,CAKJE,CAhBJ,CAbF,CAkCH,CAvDqB,CAAjB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["size","innerOffset","className","space"];import"./ListDivider.css";import React,{forwardRef}from"react";import{cnMixSpace}from"../../../mixs/MixSpace";import{cn}from"../../../utils/bem";import{
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["size","innerOffset","className","space"];import"./ListDivider.css";import React,{forwardRef}from"react";import{cnMixSpace}from"../../../mixs/MixSpace";import{cn}from"../../../utils/bem";import{mapDividerVerticalSpace,mapHorisontalSpase,mapHorisontalSpaseIncreased}from"../maps";import{defaultListPropSize}from"../types";export var cnListDivider=cn("ListDivider");export var ListDivider=forwardRef(function(a,b){var c=a.size,d=void 0===c?defaultListPropSize:c,e=a.innerOffset,f=a.className,g=a.space,h=_objectWithoutProperties(a,_excluded);return React.createElement("div",Object.assign({},h,{ref:b,className:cnListDivider(null,[cnMixSpace(g||{mH:"increased"===e?mapHorisontalSpaseIncreased[d]:mapHorisontalSpase[d],mV:mapDividerVerticalSpace[d]}),f])}))});
|
|
2
2
|
//# sourceMappingURL=ListDivider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListDivider.js","names":["React","forwardRef","cnMixSpace","cn","
|
|
1
|
+
{"version":3,"file":"ListDivider.js","names":["React","forwardRef","cnMixSpace","cn","mapDividerVerticalSpace","mapHorisontalSpase","mapHorisontalSpaseIncreased","defaultListPropSize","cnListDivider","ListDivider","props","ref","size","innerOffset","className","space","otherProps","mH","mV"],"sources":["../../../../../../src/components/ListCanary/ListDivider/ListDivider.tsx"],"sourcesContent":["import './ListDivider.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\n\nimport {\n mapDividerVerticalSpace,\n mapHorisontalSpase,\n mapHorisontalSpaseIncreased,\n} from '../maps';\nimport { defaultListPropSize, ListDividerProps } from '../types';\n\nexport const cnListDivider = cn('ListDivider');\n\nexport const ListDivider = forwardRef<HTMLDivElement, ListDividerProps>(\n (props, ref) => {\n const {\n size = defaultListPropSize,\n innerOffset,\n className,\n space,\n ...otherProps\n } = props;\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnListDivider(null, [\n cnMixSpace(\n space || {\n mH:\n innerOffset === 'increased'\n ? mapHorisontalSpaseIncreased[size]\n : mapHorisontalSpase[size],\n mV: mapDividerVerticalSpace[size],\n },\n ),\n className,\n ])}\n />\n );\n },\n);\n"],"mappings":"8IAAA,0BAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,UAAT,8BACA,OAASC,EAAT,0BAEA,OACEC,uBADF,CAEEC,kBAFF,CAGEC,2BAHF,eAKA,OAASC,mBAAT,gBAEA,MAAO,IAAMC,cAAa,CAAGL,EAAE,CAAC,aAAD,CAAxB,CAEP,MAAO,IAAMM,YAAW,CAAGR,UAAU,CACnC,SAACS,CAAD,CAAQC,CAAR,CAAgB,CACd,MAMID,CANJ,CACEE,IADF,CACEA,CADF,YACSL,mBADT,GAEEM,CAFF,CAMIH,CANJ,CAEEG,WAFF,CAGEC,CAHF,CAMIJ,CANJ,CAGEI,SAHF,CAIEC,CAJF,CAMIL,CANJ,CAIEK,KAJF,CAKKC,CALL,0BAMIN,CANJ,YAQA,MACE,4CACMM,CADN,EAEE,GAAG,CAAEL,CAFP,CAGE,SAAS,CAAEH,aAAa,CAAC,IAAD,CAAO,CAC7BN,UAAU,CACRa,CAAK,EAAI,CACPE,EAAE,CACgB,WAAhB,GAAAJ,CAAW,CACPP,2BAA2B,CAACM,CAAD,CADpB,CAEPP,kBAAkB,CAACO,CAAD,CAJjB,CAKPM,EAAE,CAAEd,uBAAuB,CAACQ,CAAD,CALpB,CADD,CADmB,CAU7BE,CAV6B,CAAP,CAH1B,GAiBH,CA5BkC,CAA9B"}
|
|
@@ -7,3 +7,4 @@ export declare const mapGroupVerticalSpaseTop: Record<ListPropSize, Space>;
|
|
|
7
7
|
export declare const mapGroupVerticalSpaseBottom: Record<ListPropSize, Space>;
|
|
8
8
|
export declare const mapItemVerticalPadding: Record<ListPropSize, Space>;
|
|
9
9
|
export declare const mapIconSize: Record<ListPropSize, IconPropSize>;
|
|
10
|
+
export declare const mapDividerVerticalSpace: Record<ListPropSize, Space>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var mapHorisontalSpase={xs:"xs",s:"xs",m:"s",l:"s"};export var mapHorisontalSpaseIncreased={xs:"s",s:"s",m:"m",l:"l"};export var mapGroupVerticalSpaseTop={xs:"s",s:"m",m:"m",l:"l"};export var mapGroupVerticalSpaseBottom={xs:"2xs",s:"2xs",m:"xs",l:"s"};export var mapItemVerticalPadding={xs:"2xs",s:"2xs",m:"xs",l:"xs"};export var mapIconSize={xs:"xs",s:"xs",m:"s",l:"s"};
|
|
1
|
+
export var mapHorisontalSpase={xs:"xs",s:"xs",m:"s",l:"s"};export var mapHorisontalSpaseIncreased={xs:"s",s:"s",m:"m",l:"l"};export var mapGroupVerticalSpaseTop={xs:"s",s:"m",m:"m",l:"l"};export var mapGroupVerticalSpaseBottom={xs:"2xs",s:"2xs",m:"xs",l:"s"};export var mapItemVerticalPadding={xs:"2xs",s:"2xs",m:"xs",l:"xs"};export var mapIconSize={xs:"xs",s:"xs",m:"s",l:"s"};export var mapDividerVerticalSpace={l:"m",m:"s",s:"xs",xs:"2xs"};
|
|
2
2
|
//# sourceMappingURL=maps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maps.js","names":["mapHorisontalSpase","xs","s","m","l","mapHorisontalSpaseIncreased","mapGroupVerticalSpaseTop","mapGroupVerticalSpaseBottom","mapItemVerticalPadding","mapIconSize"],"sources":["../../../../../src/components/ListCanary/maps.ts"],"sourcesContent":["import { IconPropSize } from '@consta/icons/Icon';\n\nimport { Space } from '##/mixs/MixSpace';\n\nimport { ListPropSize } from './types';\n\nexport const mapHorisontalSpase: Record<ListPropSize, Space> = {\n xs: 'xs',\n s: 'xs',\n m: 's',\n l: 's',\n};\n\nexport const mapHorisontalSpaseIncreased: Record<ListPropSize, Space> = {\n xs: 's',\n s: 's',\n m: 'm',\n l: 'l',\n};\n\nexport const mapGroupVerticalSpaseTop: Record<ListPropSize, Space> = {\n xs: 's',\n s: 'm',\n m: 'm',\n l: 'l',\n};\n\nexport const mapGroupVerticalSpaseBottom: Record<ListPropSize, Space> = {\n xs: '2xs',\n s: '2xs',\n m: 'xs',\n l: 's',\n};\n\nexport const mapItemVerticalPadding: Record<ListPropSize, Space> = {\n xs: '2xs',\n s: '2xs',\n m: 'xs',\n l: 'xs',\n};\n\nexport const mapIconSize: Record<ListPropSize, IconPropSize> = {\n xs: 'xs',\n s: 'xs',\n m: 's',\n l: 's',\n};\n"],"mappings":"AAMA,MAAO,IAAMA,mBAA+C,CAAG,CAC7DC,EAAE,CAAE,IADyD,CAE7DC,CAAC,CAAE,IAF0D,CAG7DC,CAAC,CAAE,GAH0D,CAI7DC,CAAC,CAAE,GAJ0D,CAAxD,CAOP,MAAO,IAAMC,4BAAwD,CAAG,CACtEJ,EAAE,CAAE,GADkE,CAEtEC,CAAC,CAAE,GAFmE,CAGtEC,CAAC,CAAE,GAHmE,CAItEC,CAAC,CAAE,GAJmE,CAAjE,CAOP,MAAO,IAAME,yBAAqD,CAAG,CACnEL,EAAE,CAAE,GAD+D,CAEnEC,CAAC,CAAE,GAFgE,CAGnEC,CAAC,CAAE,GAHgE,CAInEC,CAAC,CAAE,GAJgE,CAA9D,CAOP,MAAO,IAAMG,4BAAwD,CAAG,CACtEN,EAAE,CAAE,KADkE,CAEtEC,CAAC,CAAE,KAFmE,CAGtEC,CAAC,CAAE,IAHmE,CAItEC,CAAC,CAAE,GAJmE,CAAjE,CAOP,MAAO,IAAMI,uBAAmD,CAAG,CACjEP,EAAE,CAAE,KAD6D,CAEjEC,CAAC,CAAE,KAF8D,CAGjEC,CAAC,CAAE,IAH8D,CAIjEC,CAAC,CAAE,IAJ8D,CAA5D,CAOP,MAAO,IAAMK,YAA+C,CAAG,CAC7DR,EAAE,CAAE,IADyD,CAE7DC,CAAC,CAAE,IAF0D,CAG7DC,CAAC,CAAE,GAH0D,CAI7DC,CAAC,CAAE,GAJ0D,CAAxD"}
|
|
1
|
+
{"version":3,"file":"maps.js","names":["mapHorisontalSpase","xs","s","m","l","mapHorisontalSpaseIncreased","mapGroupVerticalSpaseTop","mapGroupVerticalSpaseBottom","mapItemVerticalPadding","mapIconSize","mapDividerVerticalSpace"],"sources":["../../../../../src/components/ListCanary/maps.ts"],"sourcesContent":["import { IconPropSize } from '@consta/icons/Icon';\n\nimport { Space } from '##/mixs/MixSpace';\n\nimport { ListPropSize } from './types';\n\nexport const mapHorisontalSpase: Record<ListPropSize, Space> = {\n xs: 'xs',\n s: 'xs',\n m: 's',\n l: 's',\n};\n\nexport const mapHorisontalSpaseIncreased: Record<ListPropSize, Space> = {\n xs: 's',\n s: 's',\n m: 'm',\n l: 'l',\n};\n\nexport const mapGroupVerticalSpaseTop: Record<ListPropSize, Space> = {\n xs: 's',\n s: 'm',\n m: 'm',\n l: 'l',\n};\n\nexport const mapGroupVerticalSpaseBottom: Record<ListPropSize, Space> = {\n xs: '2xs',\n s: '2xs',\n m: 'xs',\n l: 's',\n};\n\nexport const mapItemVerticalPadding: Record<ListPropSize, Space> = {\n xs: '2xs',\n s: '2xs',\n m: 'xs',\n l: 'xs',\n};\n\nexport const mapIconSize: Record<ListPropSize, IconPropSize> = {\n xs: 'xs',\n s: 'xs',\n m: 's',\n l: 's',\n};\n\nexport const mapDividerVerticalSpace: Record<ListPropSize, Space> = {\n l: 'm',\n m: 's',\n s: 'xs',\n xs: '2xs',\n};\n"],"mappings":"AAMA,MAAO,IAAMA,mBAA+C,CAAG,CAC7DC,EAAE,CAAE,IADyD,CAE7DC,CAAC,CAAE,IAF0D,CAG7DC,CAAC,CAAE,GAH0D,CAI7DC,CAAC,CAAE,GAJ0D,CAAxD,CAOP,MAAO,IAAMC,4BAAwD,CAAG,CACtEJ,EAAE,CAAE,GADkE,CAEtEC,CAAC,CAAE,GAFmE,CAGtEC,CAAC,CAAE,GAHmE,CAItEC,CAAC,CAAE,GAJmE,CAAjE,CAOP,MAAO,IAAME,yBAAqD,CAAG,CACnEL,EAAE,CAAE,GAD+D,CAEnEC,CAAC,CAAE,GAFgE,CAGnEC,CAAC,CAAE,GAHgE,CAInEC,CAAC,CAAE,GAJgE,CAA9D,CAOP,MAAO,IAAMG,4BAAwD,CAAG,CACtEN,EAAE,CAAE,KADkE,CAEtEC,CAAC,CAAE,KAFmE,CAGtEC,CAAC,CAAE,IAHmE,CAItEC,CAAC,CAAE,GAJmE,CAAjE,CAOP,MAAO,IAAMI,uBAAmD,CAAG,CACjEP,EAAE,CAAE,KAD6D,CAEjEC,CAAC,CAAE,KAF8D,CAGjEC,CAAC,CAAE,IAH8D,CAIjEC,CAAC,CAAE,IAJ8D,CAA5D,CAOP,MAAO,IAAMK,YAA+C,CAAG,CAC7DR,EAAE,CAAE,IADyD,CAE7DC,CAAC,CAAE,IAF0D,CAG7DC,CAAC,CAAE,GAH0D,CAI7DC,CAAC,CAAE,GAJ0D,CAAxD,CAOP,MAAO,IAAMM,wBAAoD,CAAG,CAClEN,CAAC,CAAE,GAD+D,CAElED,CAAC,CAAE,GAF+D,CAGlED,CAAC,CAAE,IAH+D,CAIlED,EAAE,CAAE,KAJ8D,CAA7D"}
|
package/__internal__/src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.css
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
.ProgressStepBarItem{align-items:flex-start;display:inline-flex;flex:1;height:100%;position:relative;width:100%}.ProgressStepBarItem_direction_horizontal{flex-direction:column}.ProgressStepBarItem_direction_horizontal .ProgressStepBarItem-Point_size_xs{margin-bottom:var(--space-2xs)}.ProgressStepBarItem_direction_horizontal .ProgressStepBarItem-Point_size_m,.ProgressStepBarItem_direction_horizontal .ProgressStepBarItem-Point_size_s{margin-bottom:var(--space-xs)}.ProgressStepBarItem_direction_vertical{flex-direction:row}.ProgressStepBarItem_direction_vertical .ProgressStepBarItem-Point{margin-right:var(--space-xs)}.ProgressStepBarItem_direction_vertical .ProgressStepBarItem-Content_size_xs{margin-top:-4px}.ProgressStepBarItem_size_xs{--progress-step-bar-item-point-size:var(--space-xs);--progress-step-bar-item-label-margin:var(--space-2xs)}.ProgressStepBarItem_size_s{--progress-step-bar-item-point-size:var(--space-m);--progress-step-bar-item-label-margin:var(--space-xs)}.ProgressStepBarItem_size_m{--progress-step-bar-item-point-size:var(--space-xl);--progress-step-bar-item-label-margin:var(--space-xs)}.ProgressStepBarItem_position_start
|
|
1
|
+
.ProgressStepBarItem{align-items:flex-start;display:inline-flex;flex:1;height:100%;position:relative;width:100%}.ProgressStepBarItem_direction_horizontal{flex-direction:column}.ProgressStepBarItem_direction_horizontal .ProgressStepBarItem-Point_size_xs{margin-bottom:var(--space-2xs)}.ProgressStepBarItem_direction_horizontal .ProgressStepBarItem-Point_size_m,.ProgressStepBarItem_direction_horizontal .ProgressStepBarItem-Point_size_s{margin-bottom:var(--space-xs)}.ProgressStepBarItem_direction_vertical{flex-direction:row}.ProgressStepBarItem_direction_vertical .ProgressStepBarItem-Point{margin-right:var(--space-xs)}.ProgressStepBarItem_direction_vertical .ProgressStepBarItem-Content_size_xs{margin-top:-4px}.ProgressStepBarItem::-webkit-scrollbar{display:none}.ProgressStepBarItem_size_xs{--progress-step-bar-item-point-size:var(--space-xs);--progress-step-bar-item-label-margin:var(--space-2xs)}.ProgressStepBarItem_size_s{--progress-step-bar-item-point-size:var(--space-m);--progress-step-bar-item-label-margin:var(--space-xs)}.ProgressStepBarItem_size_m{--progress-step-bar-item-point-size:var(--space-xl);--progress-step-bar-item-label-margin:var(--space-xs)}.ProgressStepBarItem_position_start.ProgressStepBarItem_direction_horizontal{align-items:flex-start;text-align:left}.ProgressStepBarItem_position_center.ProgressStepBarItem_direction_horizontal{align-items:center;text-align:center}.ProgressStepBarItem_position_end.ProgressStepBarItem_direction_horizontal{align-items:flex-end;text-align:right}.ProgressStepBarItem_status_system{--progress-step-bar-item-point-background:var(--color-bg-system);--progress-step-bar-item-point-content-color:var(--color-typo-secondary)}.ProgressStepBarItem_status_normal{--progress-step-bar-item-point-background:var(--color-bg-normal);--progress-step-bar-item-point-content-color:var(
|
|
2
|
+
--color-control-typo-primary
|
|
3
|
+
)}.ProgressStepBarItem_status_success{--progress-step-bar-item-point-background:var(--color-bg-success);--progress-step-bar-item-point-content-color:var(
|
|
4
|
+
--color-control-typo-primary
|
|
5
|
+
)}.ProgressStepBarItem_status_warning{--progress-step-bar-item-point-background:var(--color-bg-warning);--progress-step-bar-item-point-content-color:var(
|
|
6
|
+
--color-control-typo-primary
|
|
7
|
+
)}.ProgressStepBarItem_status_alert{--progress-step-bar-item-point-background:var(--color-bg-alert);--progress-step-bar-item-point-content-color:var(
|
|
8
|
+
--color-control-typo-primary
|
|
9
|
+
)}.ProgressStepBarItem .ProgressStepBarItem-PointIcon,.ProgressStepBarItem .ProgressStepBarItem-PointText{color:var(--progress-step-bar-item-point-content-color)}.ProgressStepBarItem .ProgressSpin{stroke:var(--progress-step-bar-item-point-content-color)}.ProgressStepBarItem-Point{align-items:center;background-color:var(--progress-step-bar-item-point-background);border:none;border-radius:calc(var(--progress-step-bar-item-point-size)*.5);color:var(--color-bg-default);display:flex;justify-content:center;margin:0;min-height:var(--progress-step-bar-item-point-size);min-width:var(--progress-step-bar-item-point-size);padding:0;transition:background-color .3s}.ProgressStepBarItem-Point_pointer{cursor:pointer}.ProgressStepBarItem-PointText.Text{line-height:var(--size-text-xs);transition:color .3s}.ProgressStepBarItem-Content_bottomOffset,.ProgressStepBarItem-Label{margin-bottom:var(--progress-step-bar-item-label-margin)}
|
package/__internal__/src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["content","tooltipContent","label","point","status","progress","direction","size","pointRef","onClick","position","tooltipZIndex","className"];import"./ProgressStepBarItem.css";import React,{useRef}from"react";import{useForkRef}from"../../../hooks/useForkRef";import{useMouseLeave}from"../../../hooks/useMouseLeave";import{useFlag}from"../../../hooks/useFlag/useFlag";import{cnMixFocus}from"../../../mixs/MixFocus/MixFocus";import{cn}from"../../../utils/bem";import{ProgressSpin}from"../../ProgressSpin/ProgressSpin";import{Text}from"../../Text/Text";import{Tooltip}from"../../Tooltip/Tooltip";import{propPositionDefault,propStatusDefault}from"../helpers";var cnProgressStepBarItem=cn("ProgressStepBarItem"),possibleVerticalDirections=["leftCenter","rightCenter","rightUp","downCenter"],possibleHorizontalDirections=["downCenter","upCenter","downStartLeft","downStartRight"],renderPointContent=function(a,b,c){if(c)return React.createElement(ProgressSpin,{size:b});if(!a)return null;if("number"==typeof a)return React.createElement(Text,{className:cnProgressStepBarItem("PointText"),size:"s"===b?"2xs":"xs",weight:"bold"},a);return React.createElement(a,{className:cnProgressStepBarItem("PointIcon"),size:"xs"})};export var ProgressStepBarItem=React.forwardRef(function(a,b){var c=a.content,d=a.tooltipContent,e=a.label,f=a.point,g=a.status,h=a.progress,i=a.direction,j=a.size,k=a.pointRef,l=a.onClick,m=a.position,n=void 0===m?propPositionDefault:m,o=a.tooltipZIndex,p=a.className,q=_objectWithoutProperties(a,_excluded),r=useFlag(),s=_slicedToArray(r,2),t=s[0],u=s[1],v=useRef(null),w=useRef(null),x=useRef(null),y=useForkRef([x,k]),z={onMouseEnter:u.on,className:cnProgressStepBarItem("Point",{size:j,pointer:!!l},[l?cnMixFocus():void 0]),children:"xs"!==j&&renderPointContent(f,j,h),ref:y,onClick:l};return useMouseLeave({isActive:t,refs:[v,x,w],handler:u.off,debounce:100}),React.createElement(React.Fragment,null,React.createElement("div",Object.assign({ref:b,className:cnProgressStepBarItem({direction:i,position:n,status:g||propStatusDefault,size:j},[p])},q),React.createElement("button",Object.assign({tabIndex:-1,type:"button"},z)),(e||c)&&React.createElement("div",{className:cnProgressStepBarItem("Content",{bottomOffset:!!c})},e&&React.createElement(Text,{className:cnProgressStepBarItem("Label"),ref:v,size:j,onMouseEnter:u.on,lineHeight:"s"===j?"xs":j,view:"primary"},e),c)),d&&t&&React.createElement(Tooltip,{ref:w,anchorRef:
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["content","tooltipContent","label","point","status","progress","direction","size","pointRef","onClick","position","tooltipZIndex","className"];import"./ProgressStepBarItem.css";import React,{useMemo,useRef}from"react";import{useForkRef}from"../../../hooks/useForkRef";import{useMouseLeave}from"../../../hooks/useMouseLeave";import{useFlag}from"../../../hooks/useFlag/useFlag";import{cnMixFocus}from"../../../mixs/MixFocus/MixFocus";import{cn}from"../../../utils/bem";import{ProgressSpin}from"../../ProgressSpin/ProgressSpin";import{Text}from"../../Text/Text";import{Tooltip}from"../../Tooltip/Tooltip";import{propPositionDefault,propStatusDefault}from"../helpers";var cnProgressStepBarItem=cn("ProgressStepBarItem"),possibleVerticalDirections=["leftCenter","rightCenter","rightUp","downCenter"],possibleHorizontalDirections=["downCenter","upCenter","downStartLeft","downStartRight"],renderPointContent=function(a,b,c){if(c)return React.createElement(ProgressSpin,{size:b});if(!a)return null;if("number"==typeof a)return React.createElement(Text,{className:cnProgressStepBarItem("PointText"),size:"s"===b?"2xs":"xs",weight:"bold"},a);return React.createElement(a,{className:cnProgressStepBarItem("PointIcon"),size:"xs"})};export var ProgressStepBarItem=React.forwardRef(function(a,b){var c=a.content,d=a.tooltipContent,e=a.label,f=a.point,g=a.status,h=a.progress,i=a.direction,j=a.size,k=a.pointRef,l=a.onClick,m=a.position,n=void 0===m?propPositionDefault:m,o=a.tooltipZIndex,p=a.className,q=_objectWithoutProperties(a,_excluded),r=useFlag(),s=_slicedToArray(r,2),t=s[0],u=s[1],v=useRef(null),w=useRef(null),x=useRef(null),y=useForkRef([x,k]),z={onMouseEnter:u.on,className:cnProgressStepBarItem("Point",{size:j,pointer:!!l},[l?cnMixFocus():void 0]),children:"xs"!==j&&renderPointContent(f,j,h),ref:y,onClick:l},A=useMemo(function(){if("vertical"===i)return{tooltipDirection:"leftUp",possibleDirections:possibleVerticalDirections,spareDirection:"rightCenter"};var a="downCenter";return"start"===n&&(a="rightCenter"),"end"===n&&(a="leftCenter"),{tooltipDirection:"downCenter",possibleDirections:possibleHorizontalDirections,spareDirection:a}},[i,n]),B=A.tooltipDirection,C=A.possibleDirections,D=A.spareDirection;return useMouseLeave({isActive:t,refs:[v,x,w],handler:u.off,debounce:100}),React.createElement(React.Fragment,null,React.createElement("div",Object.assign({ref:b,className:cnProgressStepBarItem({direction:i,position:n,status:g||propStatusDefault,size:j},[p])},q),React.createElement("button",Object.assign({tabIndex:-1,type:"button"},z)),(e||c)&&React.createElement("div",{className:cnProgressStepBarItem("Content",{bottomOffset:!!c})},e&&React.createElement(Text,{className:cnProgressStepBarItem("Label"),ref:v,size:j,onMouseEnter:u.on,lineHeight:"s"===j?"xs":j,view:"primary"},e),c)),d&&t&&React.createElement(Tooltip,{ref:w,anchorRef:x,className:cnProgressStepBarItem("Tooltip"),direction:B,style:{zIndex:o},isInteractive:!1,possibleDirections:C,spareDirection:D},d))});
|
|
2
2
|
//# sourceMappingURL=ProgressStepBarItem.js.map
|
package/__internal__/src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressStepBarItem.js","names":["React","useRef","useForkRef","useMouseLeave","useFlag","cnMixFocus","cn","ProgressSpin","Text","Tooltip","propPositionDefault","propStatusDefault","cnProgressStepBarItem","possibleVerticalDirections","possibleHorizontalDirections","renderPointContent","point","size","progress","ProgressStepBarItem","forwardRef","props","ref","content","tooltipContent","label","status","direction","pointRefProp","pointRef","onClick","position","tooltipZIndex","className","otherProps","isTooltipVisible","setTooltipVisible","anchorRef","tooltipRef","pointForkedRef","pointProps","onMouseEnter","on","pointer","children","isActive","refs","handler","off","debounce","bottomOffset","zIndex"],"sources":["../../../../../../src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.tsx"],"sourcesContent":["import './ProgressStepBarItem.css';\n\nimport { IconComponent } from '@consta/icons/Icon';\nimport React, { useRef } from 'react';\n\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { useMouseLeave } from '##/hooks/useMouseLeave';\n\nimport { useFlag } from '../../../hooks/useFlag/useFlag';\nimport { cnMixFocus } from '../../../mixs/MixFocus/MixFocus';\nimport { cn } from '../../../utils/bem';\nimport { Direction } from '../../Popover/Popover';\nimport { ProgressSpin } from '../../ProgressSpin/ProgressSpin';\nimport { Text } from '../../Text/Text';\nimport { Tooltip } from '../../Tooltip/Tooltip';\nimport {\n PointNumbersMap,\n ProgressStepBarItemComponent,\n propPositionDefault,\n propStatusDefault,\n} from '../helpers';\n\nconst cnProgressStepBarItem = cn('ProgressStepBarItem');\n\nconst possibleVerticalDirections: Direction[] = [\n 'leftCenter',\n 'rightCenter',\n 'rightUp',\n 'downCenter',\n];\nconst possibleHorizontalDirections: Direction[] = [\n 'downCenter',\n 'upCenter',\n 'downStartLeft',\n 'downStartRight',\n];\n\nconst renderPointContent = (\n point: PointNumbersMap | IconComponent | undefined,\n size: 'm' | 's',\n progress: boolean | undefined,\n) => {\n if (progress) return <ProgressSpin size={size} />;\n if (!point) return null;\n\n if (typeof point === 'number') {\n return (\n <Text\n className={cnProgressStepBarItem('PointText')}\n size={size === 's' ? '2xs' : 'xs'}\n weight=\"bold\"\n >\n {point}\n </Text>\n );\n }\n\n const Icon = point;\n\n return <Icon className={cnProgressStepBarItem('PointIcon')} size=\"xs\" />;\n};\n\nexport const ProgressStepBarItem: ProgressStepBarItemComponent =\n React.forwardRef((props, ref) => {\n const {\n content,\n tooltipContent,\n label,\n point,\n status,\n progress,\n direction,\n size,\n pointRef: pointRefProp,\n onClick,\n position = propPositionDefault,\n tooltipZIndex,\n className,\n ...otherProps\n } = props;\n\n const [isTooltipVisible, setTooltipVisible] = useFlag();\n\n const anchorRef = useRef<HTMLDivElement>(null);\n const tooltipRef = useRef<HTMLDivElement>(null);\n const pointRef = useRef<HTMLButtonElement>(null);\n\n const pointForkedRef = useForkRef([pointRef, pointRefProp]);\n\n const pointProps = {\n onMouseEnter: setTooltipVisible.on,\n className: cnProgressStepBarItem(\n 'Point',\n {\n size,\n pointer: !!onClick,\n },\n [onClick ? cnMixFocus() : undefined],\n ),\n children: size !== 'xs' && renderPointContent(point, size, progress),\n ref: pointForkedRef,\n onClick,\n };\n\n useMouseLeave({\n isActive: isTooltipVisible,\n refs: [anchorRef, pointRef, tooltipRef],\n handler: setTooltipVisible.off,\n debounce: 100,\n });\n\n return (\n <>\n <div\n ref={ref}\n className={cnProgressStepBarItem(\n {\n direction,\n position,\n status: status || propStatusDefault,\n size,\n },\n [className],\n )}\n {...otherProps}\n >\n <button tabIndex={-1} type=\"button\" {...pointProps} />\n {(label || content) && (\n <div\n className={cnProgressStepBarItem('Content', {\n bottomOffset: !!content,\n })}\n >\n {label && (\n <Text\n className={cnProgressStepBarItem('Label')}\n ref={anchorRef}\n size={size}\n onMouseEnter={setTooltipVisible.on}\n lineHeight={size === 's' ? 'xs' : size}\n view=\"primary\"\n >\n {label}\n </Text>\n )}\n {content}\n </div>\n )}\n </div>\n {tooltipContent && isTooltipVisible && (\n <Tooltip\n ref={tooltipRef}\n anchorRef={
|
|
1
|
+
{"version":3,"file":"ProgressStepBarItem.js","names":["React","useMemo","useRef","useForkRef","useMouseLeave","useFlag","cnMixFocus","cn","ProgressSpin","Text","Tooltip","propPositionDefault","propStatusDefault","cnProgressStepBarItem","possibleVerticalDirections","possibleHorizontalDirections","renderPointContent","point","size","progress","ProgressStepBarItem","forwardRef","props","ref","content","tooltipContent","label","status","direction","pointRefProp","pointRef","onClick","position","tooltipZIndex","className","otherProps","isTooltipVisible","setTooltipVisible","anchorRef","tooltipRef","pointForkedRef","pointProps","onMouseEnter","on","pointer","children","tooltipDirection","possibleDirections","spareDirection","isActive","refs","handler","off","debounce","bottomOffset","zIndex"],"sources":["../../../../../../src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.tsx"],"sourcesContent":["import './ProgressStepBarItem.css';\n\nimport { IconComponent } from '@consta/icons/Icon';\nimport React, { useMemo, useRef } from 'react';\n\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { useMouseLeave } from '##/hooks/useMouseLeave';\n\nimport { useFlag } from '../../../hooks/useFlag/useFlag';\nimport { cnMixFocus } from '../../../mixs/MixFocus/MixFocus';\nimport { cn } from '../../../utils/bem';\nimport { Direction } from '../../Popover/Popover';\nimport { ProgressSpin } from '../../ProgressSpin/ProgressSpin';\nimport { Text } from '../../Text/Text';\nimport { Tooltip } from '../../Tooltip/Tooltip';\nimport {\n PointNumbersMap,\n ProgressStepBarItemComponent,\n propPositionDefault,\n propStatusDefault,\n} from '../helpers';\n\nconst cnProgressStepBarItem = cn('ProgressStepBarItem');\n\nconst possibleVerticalDirections: Direction[] = [\n 'leftCenter',\n 'rightCenter',\n 'rightUp',\n 'downCenter',\n];\nconst possibleHorizontalDirections: Direction[] = [\n 'downCenter',\n 'upCenter',\n 'downStartLeft',\n 'downStartRight',\n];\n\nconst renderPointContent = (\n point: PointNumbersMap | IconComponent | undefined,\n size: 'm' | 's',\n progress: boolean | undefined,\n) => {\n if (progress) return <ProgressSpin size={size} />;\n if (!point) return null;\n\n if (typeof point === 'number') {\n return (\n <Text\n className={cnProgressStepBarItem('PointText')}\n size={size === 's' ? '2xs' : 'xs'}\n weight=\"bold\"\n >\n {point}\n </Text>\n );\n }\n\n const Icon = point;\n\n return <Icon className={cnProgressStepBarItem('PointIcon')} size=\"xs\" />;\n};\n\nexport const ProgressStepBarItem: ProgressStepBarItemComponent =\n React.forwardRef((props, ref) => {\n const {\n content,\n tooltipContent,\n label,\n point,\n status,\n progress,\n direction,\n size,\n pointRef: pointRefProp,\n onClick,\n position = propPositionDefault,\n tooltipZIndex,\n className,\n ...otherProps\n } = props;\n\n const [isTooltipVisible, setTooltipVisible] = useFlag();\n\n const anchorRef = useRef<HTMLDivElement>(null);\n const tooltipRef = useRef<HTMLDivElement>(null);\n const pointRef = useRef<HTMLButtonElement>(null);\n\n const pointForkedRef = useForkRef([pointRef, pointRefProp]);\n\n const pointProps = {\n onMouseEnter: setTooltipVisible.on,\n className: cnProgressStepBarItem(\n 'Point',\n {\n size,\n pointer: !!onClick,\n },\n [onClick ? cnMixFocus() : undefined],\n ),\n children: size !== 'xs' && renderPointContent(point, size, progress),\n ref: pointForkedRef,\n onClick,\n };\n\n const { tooltipDirection, possibleDirections, spareDirection } = useMemo<{\n tooltipDirection: Direction;\n possibleDirections: Direction[];\n spareDirection: Direction;\n }>(() => {\n if (direction === 'vertical') {\n return {\n tooltipDirection: 'leftUp',\n possibleDirections: possibleVerticalDirections,\n spareDirection: 'rightCenter',\n };\n }\n let spareDirection: Direction = 'downCenter';\n if (position === 'start') {\n spareDirection = 'rightCenter';\n }\n if (position === 'end') {\n spareDirection = 'leftCenter';\n }\n return {\n tooltipDirection: 'downCenter',\n possibleDirections: possibleHorizontalDirections,\n spareDirection,\n };\n }, [direction, position]);\n\n useMouseLeave({\n isActive: isTooltipVisible,\n refs: [anchorRef, pointRef, tooltipRef],\n handler: setTooltipVisible.off,\n debounce: 100,\n });\n\n return (\n <>\n <div\n ref={ref}\n className={cnProgressStepBarItem(\n {\n direction,\n position,\n status: status || propStatusDefault,\n size,\n },\n [className],\n )}\n {...otherProps}\n >\n <button tabIndex={-1} type=\"button\" {...pointProps} />\n {(label || content) && (\n <div\n className={cnProgressStepBarItem('Content', {\n bottomOffset: !!content,\n })}\n >\n {label && (\n <Text\n className={cnProgressStepBarItem('Label')}\n ref={anchorRef}\n size={size}\n onMouseEnter={setTooltipVisible.on}\n lineHeight={size === 's' ? 'xs' : size}\n view=\"primary\"\n >\n {label}\n </Text>\n )}\n {content}\n </div>\n )}\n </div>\n {tooltipContent && isTooltipVisible && (\n <Tooltip\n ref={tooltipRef}\n anchorRef={pointRef}\n className={cnProgressStepBarItem('Tooltip')}\n direction={tooltipDirection}\n style={{ zIndex: tooltipZIndex }}\n isInteractive={false}\n possibleDirections={possibleDirections}\n spareDirection={spareDirection}\n >\n {tooltipContent}\n </Tooltip>\n )}\n </>\n );\n });\n"],"mappings":"oTAAA,kCAGA,MAAOA,MAAP,EAAgBC,OAAhB,CAAyBC,MAAzB,KAAuC,OAAvC,CAEA,OAASC,UAAT,iCACA,OAASC,aAAT,oCAEA,OAASC,OAAT,sCACA,OAASC,UAAT,uCACA,OAASC,EAAT,0BAEA,OAASC,YAAT,uCACA,OAASC,IAAT,uBACA,OAASC,OAAT,6BACA,OAGEC,mBAHF,CAIEC,iBAJF,kB,GAOMC,sBAAqB,CAAGN,EAAE,CAAC,qBAAD,C,CAE1BO,0BAAuC,CAAG,CAC9C,YAD8C,CAE9C,aAF8C,CAG9C,SAH8C,CAI9C,YAJ8C,C,CAM1CC,4BAAyC,CAAG,CAChD,YADgD,CAEhD,UAFgD,CAGhD,eAHgD,CAIhD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B,CAAC,SAAD,CAHlC,CAIE,SAAS,CAAEiC,CAJb,CAKE,KAAK,CAAE,CAAES,MAAM,CAAEtB,CAAV,CALT,CAME,aAAa,GANf,CAOE,kBAAkB,CAAEc,CAPtB,CAQE,cAAc,CAAEC,CARlB,EAUGvB,CAVH,CAtCJ,CAqDH,CAhID,CADK"}
|
package/__internal__/src/components/ProgressStepBar/ProgressStepBarLine/ProgressStepBarLine.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["lines","activeStepIndex","size","direction"];import"./ProgressStepBarLine.css";import React from"react";import{cn}from"../../../utils/bem";var cnProgressStepBarLine=cn("ProgressStepBarLine"),getActiveLineSize=function(a,b){var c=b.map(function(a){var b=a.size;return b}),d=a?Math.max(a,0):void 0;return"number"!=typeof d||0===d?0:c.splice(0,d).reduce(function(c,a){return c+a})},getPathParams=function(a,b){var c=[],d=0;return a.forEach(function(a){var e=a.size,f=a.status;c.push({width:"horizontal"===b?e:"var(--progress-step-bar-line-width)",height:"horizontal"===b?"var(--progress-step-bar-line-height)":e,x:"horizontal"===b?d:0,y:"horizontal"===b?0:d,fill:"var(--color-bg-".concat(f||"normal",")")}),d+=e}),c};export var ProgressStepBarLine=function(a){var b,c=a.lines,d=a.activeStepIndex,e=a.size,f=a.direction,g=_objectWithoutProperties(a,_excluded),h=c.map(function(a){var b=a.size;return b}).reduce(function(c,a){return c+a}),i=getActiveLineSize(d,c);return React.createElement("div",Object.assign({},g,{className:cnProgressStepBarLine({size:e,direction:f}),style:(b={},_defineProperty(b,"--line-size","".concat(h,"px")),_defineProperty(b,"--line-active-size","".concat(i,"px")),b)}),React.createElement("svg",{className:cnProgressStepBarLine("Svg"),width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg"},getPathParams(c,f).map(function(a,b){var c=a.fill,d=a.height,e=a.width,f=a.x,g=a.y;return React.createElement("rect",{key:b,style:{height:d,width:e,fill:c},x:f,y:g})})))};
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["lines","activeStepIndex","size","direction"];import"./ProgressStepBarLine.css";import React from"react";import{cn}from"../../../utils/bem";var cnProgressStepBarLine=cn("ProgressStepBarLine"),getActiveLineSize=function(a,b){var c=b.map(function(a){var b=a.size;return b}),d=a?Math.max(a,0):void 0;return"number"!=typeof d||0===d?0:c.splice(0,d).reduce(function(c,a){return c+a})},getPathParams=function(a,b){var c=[],d=0;return a.forEach(function(a){var e=a.size,f=a.status;c.push({width:"horizontal"===b?e:"var(--progress-step-bar-line-width)",height:"horizontal"===b?"var(--progress-step-bar-line-height)":e,x:"horizontal"===b?d:0,y:"horizontal"===b?0:d,fill:"var(--color-bg-".concat(f||"normal",")")}),d+=e}),c};export var ProgressStepBarLine=function(a){var b,c=a.lines,d=a.activeStepIndex,e=a.size,f=a.direction,g=_objectWithoutProperties(a,_excluded),h=c.map(function(a){var b=a.size;return b}).reduce(function(c,a){return c+a},0),i=getActiveLineSize(d,c);return React.createElement("div",Object.assign({},g,{className:cnProgressStepBarLine({size:e,direction:f}),style:(b={},_defineProperty(b,"--line-size","".concat(h,"px")),_defineProperty(b,"--line-active-size","".concat(i,"px")),b)}),React.createElement("svg",{className:cnProgressStepBarLine("Svg"),width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg"},getPathParams(c,f).map(function(a,b){var c=a.fill,d=a.height,e=a.width,f=a.x,g=a.y;return React.createElement("rect",{key:b,style:{height:d,width:e,fill:c},x:f,y:g})})))};
|
|
2
2
|
//# sourceMappingURL=ProgressStepBarLine.js.map
|
package/__internal__/src/components/ProgressStepBar/ProgressStepBarLine/ProgressStepBarLine.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressStepBarLine.js","names":["React","cn","cnProgressStepBarLine","getActiveLineSize","activeStepIndex","lines","lineSizes","map","size","active","Math","max","splice","reduce","a","b","getPathParams","direction","paths","width","forEach","status","push","height","x","y","fill","ProgressStepBarLine","props","otherProps","lineSize","activeLineSize","index"],"sources":["../../../../../../src/components/ProgressStepBar/ProgressStepBarLine/ProgressStepBarLine.tsx"],"sourcesContent":["import './ProgressStepBarLine.css';\n\nimport React from 'react';\n\nimport { cn } from '../../../utils/bem';\nimport { Line, PropDirection, PropSize } from '../helpers';\n\ntype ProgressStepBarLineProps = {\n lines: Line[];\n size: PropSize;\n direction: PropDirection;\n activeStepIndex?: number;\n};\n\nconst cnProgressStepBarLine = cn('ProgressStepBarLine');\n\nconst getActiveLineSize = (\n activeStepIndex: number | undefined,\n lines: Line[],\n) => {\n const lineSizes = lines.map(({ size }) => size);\n const active = activeStepIndex ? Math.max(activeStepIndex, 0) : undefined;\n if (typeof active !== 'number' || active === 0) {\n return 0;\n }\n\n return lineSizes.splice(0, active).reduce((a, b) => a + b);\n};\n\ntype PathItem = {\n fill: string;\n height: string | number;\n width: string | number;\n x: number;\n y: number;\n};\nconst getPathParams = (lines: Line[], direction: PropDirection) => {\n const paths: PathItem[] = [];\n let width = 0;\n lines.forEach(({ size, status }) => {\n paths.push({\n width:\n direction === 'horizontal'\n ? size\n : 'var(--progress-step-bar-line-width)',\n height:\n direction === 'horizontal'\n ? 'var(--progress-step-bar-line-height)'\n : size,\n x: direction === 'horizontal' ? width : 0,\n y: direction === 'horizontal' ? 0 : width,\n fill: `var(--color-bg-${status || 'normal'})`,\n });\n width += size;\n });\n return paths;\n};\n\nexport const ProgressStepBarLine = (props: ProgressStepBarLineProps) => {\n const { lines, activeStepIndex, size, direction, ...otherProps } = props;\n const lineSize = lines.map(({ size }) => size).reduce((a, b) => a + b);\n const activeLineSize = getActiveLineSize(activeStepIndex, lines);\n\n return (\n <div\n {...otherProps}\n className={cnProgressStepBarLine({ size, direction })}\n style={{\n ['--line-size' as string]: `${lineSize}px`,\n ['--line-active-size' as string]: `${activeLineSize}px`,\n }}\n >\n <svg\n className={cnProgressStepBarLine('Svg')}\n width=\"100%\"\n height=\"100%\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n {getPathParams(lines, direction).map(\n ({ fill, height, width, x, y }, index) => (\n <rect key={index} style={{ height, width, fill }} x={x} y={y} />\n ),\n )}\n </svg>\n </div>\n );\n};\n"],"mappings":"qNAAA,kCAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,0B,GAUMC,sBAAqB,CAAGD,EAAE,CAAC,qBAAD,C,CAE1BE,iBAAiB,CAAG,SACxBC,CADwB,CAExBC,CAFwB,CAGrB,IACGC,EAAS,CAAGD,CAAK,CAACE,GAAN,CAAU,eAAGC,EAAH,GAAGA,IAAH,OAAcA,EAAd,CAAV,CADf,CAEGC,CAAM,CAAGL,CAAe,CAAGM,IAAI,CAACC,GAAL,CAASP,CAAT,CAA0B,CAA1B,CAAH,OAF3B,OAGmB,QAAlB,QAAOK,EAAP,EAAyC,CAAX,GAAAA,CAH/B,CAIM,CAJN,CAOIH,CAAS,CAACM,MAAV,CAAiB,CAAjB,CAAoBH,CAApB,EAA4BI,MAA5B,CAAmC,SAACC,CAAD,CAAIC,CAAJ,QAAUD,EAAC,CAAGC,CAAd,CAAnC,CACR,C,CASKC,aAAa,CAAG,SAACX,CAAD,CAAgBY,CAAhB,CAA6C,IAC3DC,EAAiB,CAAG,EADuC,CAE7DC,CAAK,CAAG,CAFqD,CAmBjE,MAhBAd,EAAK,CAACe,OAAN,CAAc,WAAsB,IAAnBZ,EAAmB,GAAnBA,IAAmB,CAAba,CAAa,GAAbA,MAAa,CAClCH,CAAK,CAACI,IAAN,CAAW,CACTH,KAAK,CACW,YAAd,GAAAF,CAAS,CACLT,CADK,CAEL,qCAJG,CAKTe,MAAM,CACU,YAAd,GAAAN,CAAS,CACL,sCADK,CAELT,CARG,CASTgB,CAAC,CAAgB,YAAd,GAAAP,CAAS,CAAoBE,CAApB,CAA4B,CAT/B,CAUTM,C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AG,CAAEO,CAAX,CAAkB,KAAK,CAAE,CAAET,MAAM,CAANA,CAAF,CAAUJ,KAAK,CAALA,CAAV,CAAiBO,IAAI,CAAJA,CAAjB,CAAzB,CAAkD,CAAC,CAAEF,CAArD,CAAwD,CAAC,CAAEC,CAA3D,EADF,CADD,CANH,CARF,CAsBH,CA5BM"}
|
|
1
|
+
{"version":3,"file":"ProgressStepBarLine.js","names":["React","cn","cnProgressStepBarLine","getActiveLineSize","activeStepIndex","lines","lineSizes","map","size","active","Math","max","splice","reduce","a","b","getPathParams","direction","paths","width","forEach","status","push","height","x","y","fill","ProgressStepBarLine","props","otherProps","lineSize","activeLineSize","index"],"sources":["../../../../../../src/components/ProgressStepBar/ProgressStepBarLine/ProgressStepBarLine.tsx"],"sourcesContent":["import './ProgressStepBarLine.css';\n\nimport React from 'react';\n\nimport { cn } from '../../../utils/bem';\nimport { Line, PropDirection, PropSize } from '../helpers';\n\ntype ProgressStepBarLineProps = {\n lines: Line[];\n size: PropSize;\n direction: PropDirection;\n activeStepIndex?: number;\n};\n\nconst cnProgressStepBarLine = cn('ProgressStepBarLine');\n\nconst getActiveLineSize = (\n activeStepIndex: number | undefined,\n lines: Line[],\n) => {\n const lineSizes = lines.map(({ size }) => size);\n const active = activeStepIndex ? Math.max(activeStepIndex, 0) : undefined;\n if (typeof active !== 'number' || active === 0) {\n return 0;\n }\n\n return lineSizes.splice(0, active).reduce((a, b) => a + b);\n};\n\ntype PathItem = {\n fill: string;\n height: string | number;\n width: string | number;\n x: number;\n y: number;\n};\nconst getPathParams = (lines: Line[], direction: PropDirection) => {\n const paths: PathItem[] = [];\n let width = 0;\n lines.forEach(({ size, status }) => {\n paths.push({\n width:\n direction === 'horizontal'\n ? size\n : 'var(--progress-step-bar-line-width)',\n height:\n direction === 'horizontal'\n ? 'var(--progress-step-bar-line-height)'\n : size,\n x: direction === 'horizontal' ? width : 0,\n y: direction === 'horizontal' ? 0 : width,\n fill: `var(--color-bg-${status || 'normal'})`,\n });\n width += size;\n });\n return paths;\n};\n\nexport const ProgressStepBarLine = (props: ProgressStepBarLineProps) => {\n const { lines, activeStepIndex, size, direction, ...otherProps } = props;\n const lineSize = lines.map(({ size }) => size).reduce((a, b) => a + b, 0);\n const activeLineSize = getActiveLineSize(activeStepIndex, lines);\n\n return (\n <div\n {...otherProps}\n className={cnProgressStepBarLine({ size, direction })}\n style={{\n ['--line-size' as string]: `${lineSize}px`,\n ['--line-active-size' as string]: `${activeLineSize}px`,\n }}\n >\n <svg\n className={cnProgressStepBarLine('Svg')}\n width=\"100%\"\n height=\"100%\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n {getPathParams(lines, direction).map(\n ({ fill, height, width, x, y }, index) => (\n <rect key={index} style={{ height, width, fill }} x={x} y={y} />\n ),\n )}\n </svg>\n </div>\n );\n};\n"],"mappings":"qNAAA,kCAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,0B,GAUMC,sBAAqB,CAAGD,EAAE,CAAC,qBAAD,C,CAE1BE,iBAAiB,CAAG,SACxBC,CADwB,CAExBC,CAFwB,CAGrB,IACGC,EAAS,CAAGD,CAAK,CAACE,GAAN,CAAU,eAAGC,EAAH,GAAGA,IAAH,OAAcA,EAAd,CAAV,CADf,CAEGC,CAAM,CAAGL,CAAe,CAAGM,IAAI,CAACC,GAAL,CAASP,CAAT,CAA0B,CAA1B,CAAH,OAF3B,OAGmB,QAAlB,QAAOK,EAAP,EAAyC,CAAX,GAAAA,CAH/B,CAIM,CAJN,CAOIH,CAAS,CAACM,MAAV,CAAiB,CAAjB,CAAoBH,CAApB,EAA4BI,MAA5B,CAAmC,SAACC,CAAD,CAAIC,CAAJ,QAAUD,EAAC,CAAGC,CAAd,CAAnC,CACR,C,CASKC,aAAa,CAAG,SAACX,CAAD,CAAgBY,CAAhB,CAA6C,IAC3DC,EAAiB,CAAG,EADuC,CAE7DC,CAAK,CAAG,CAFqD,CAmBjE,MAhBAd,EAAK,CAACe,OAAN,CAAc,W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K,CAAC,MAFR,CAGE,MAAM,CAAC,MAHT,CAIE,KAAK,CAAC,4BAJR,EAMGc,aAAa,CAACX,CAAD,CAAQY,CAAR,CAAb,CAAgCV,GAAhC,CACC,WAAgCyB,CAAhC,KAAGN,EAAH,GAAGA,IAAH,CAASH,CAAT,GAASA,MAAT,CAAiBJ,CAAjB,GAAiBA,KAAjB,CAAwBK,CAAxB,GAAwBA,CAAxB,CAA2BC,CAA3B,GAA2BA,CAA3B,OACE,6BAAM,GAAG,CAAEO,CAAX,CAAkB,KAAK,CAAE,CAAET,MAAM,CAANA,CAAF,CAAUJ,KAAK,CAALA,CAAV,CAAiBO,IAAI,CAAJA,CAAjB,CAAzB,CAAkD,CAAC,CAAEF,CAArD,CAAwD,CAAC,CAAEC,CAA3D,EADF,CADD,CANH,CARF,CAsBH,CA5BM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.RadioGroup{display:flex}.RadioGroup_direction_column{flex-direction:column}.RadioGroup_direction_column .RadioGroup-Item:not(:last-child){margin-bottom:var(--offset)}.RadioGroup_direction_row{flex-direction:row}.RadioGroup_direction_row .RadioGroup-Item:not(:last-child){margin-right:var(--offset)}.RadioGroup_size_xs{--offset:var(--space-
|
|
1
|
+
.RadioGroup{display:flex}.RadioGroup_direction_column{flex-direction:column}.RadioGroup_direction_column .RadioGroup-Item:not(:last-child){margin-bottom:var(--offset)}.RadioGroup_direction_row{flex-direction:row}.RadioGroup_direction_row .RadioGroup-Item:not(:last-child){margin-right:var(--offset)}.RadioGroup_size_xs{--offset:var(--space-2xs)}.RadioGroup_size_m,.RadioGroup_size_s{--offset:var(--space-xs)}.RadioGroup_size_l{--offset:var(--space-s)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["value","items","getItemLabel","getItemDisabled","onChange","name","direction","size","view","align","disabled","className"];import"./RadioGroup.css";import React,{forwardRef}from"react";import{useChoiceGroup}from"../../hooks/useChoiceGroup/useChoiceGroup";import{cn}from"../../utils/bem";import{Radio}from"../Radio/Radio";import{withDefaultGetters}from"./helper";import{radioGroupDefaultDirection,radioGroupDefaultSize,radioGroupDefaultView,radioGroupPropAlignDefault}from"./types";export var cnRadioGroup=cn("RadioGroup");var RadioGroupRender=function(a,b){var c=withDefaultGetters(a),d=c.value,e=void 0===d?null:d,f=c.items,g=c.getItemLabel,h=c.
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["value","items","getItemLabel","getItemKey","getItemDisabled","onChange","name","direction","size","view","align","disabled","className"];import"./RadioGroup.css";import React,{forwardRef}from"react";import{useChoiceGroup}from"../../hooks/useChoiceGroup/useChoiceGroup";import{cn}from"../../utils/bem";import{Radio}from"../Radio/Radio";import{withDefaultGetters}from"./helper";import{radioGroupDefaultDirection,radioGroupDefaultSize,radioGroupDefaultView,radioGroupPropAlignDefault}from"./types";export var cnRadioGroup=cn("RadioGroup");var RadioGroupRender=function(a,b){var c=withDefaultGetters(a),d=c.value,e=void 0===d?null:d,f=c.items,g=c.getItemLabel,h=c.getItemKey,i=c.getItemDisabled,j=c.onChange,k=c.name,l=c.direction,m=void 0===l?radioGroupDefaultDirection:l,n=c.size,o=void 0===n?radioGroupDefaultSize:n,p=c.view,q=void 0===p?radioGroupDefaultView:p,r=c.align,s=void 0===r?radioGroupPropAlignDefault:r,t=c.disabled,u=c.className,v=_objectWithoutProperties(c,_excluded),w=useChoiceGroup({value:e,getKey:function getKey(a){var b;return null!==(b=h(a))&&void 0!==b?b:g(a)},callBack:j,multiple:!1}),x=w.getOnChange,y=w.getChecked;return React.createElement("div",Object.assign({},v,{ref:b,className:cnRadioGroup({direction:m,size:o,view:q},[u])}),f.map(function(a){var b;return React.createElement(Radio,{align:s,key:null!==(b=h(a))&&void 0!==b?b:g(a),label:g(a),size:o,view:q,name:k,disabled:void 0!==t&&t||!!i&&i(a),checked:y(a),onChange:function(b){var c=b.e;return x(a)(c)},className:cnRadioGroup("Item")})}))};export var RadioGroup=forwardRef(RadioGroupRender);export*from"./types";
|
|
2
2
|
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","names":["React","forwardRef","useChoiceGroup","cn","Radio","withDefaultGetters","radioGroupDefaultDirection","radioGroupDefaultSize","radioGroupDefaultView","radioGroupPropAlignDefault","cnRadioGroup","RadioGroupRender","props","ref","value","items","getItemLabel","getItemDisabled","onChange","name","direction","size","view","align","disabled","className","otherProps","getKey","callBack","multiple","getOnChange","getChecked","map","
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","names":["React","forwardRef","useChoiceGroup","cn","Radio","withDefaultGetters","radioGroupDefaultDirection","radioGroupDefaultSize","radioGroupDefaultView","radioGroupPropAlignDefault","cnRadioGroup","RadioGroupRender","props","ref","value","items","getItemLabel","getItemKey","getItemDisabled","onChange","name","direction","size","view","align","disabled","className","otherProps","getKey","item","callBack","multiple","getOnChange","getChecked","map","e","RadioGroup"],"sources":["../../../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import './RadioGroup.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { useChoiceGroup } from '../../hooks/useChoiceGroup/useChoiceGroup';\nimport { cn } from '../../utils/bem';\nimport { Radio } from '../Radio/Radio';\nimport { withDefaultGetters } from './helper';\nimport {\n RadioGroupComponent,\n radioGroupDefaultDirection,\n radioGroupDefaultSize,\n radioGroupDefaultView,\n radioGroupPropAlignDefault,\n RadioGroupProps,\n} from './types';\n\nexport const cnRadioGroup = cn('RadioGroup');\n\nconst RadioGroupRender = (\n props: RadioGroupProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n value = null,\n items,\n getItemLabel,\n getItemKey,\n getItemDisabled,\n onChange,\n name,\n direction = radioGroupDefaultDirection,\n size = radioGroupDefaultSize,\n view = radioGroupDefaultView,\n align = radioGroupPropAlignDefault,\n disabled = false,\n className,\n ...otherProps\n } = withDefaultGetters(props);\n\n const { getOnChange, getChecked } = useChoiceGroup({\n value,\n getKey: (item) => getItemKey(item) ?? getItemLabel(item),\n callBack: onChange,\n multiple: false,\n });\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnRadioGroup({ direction, size, view }, [className])}\n >\n {items.map((item) => (\n <Radio\n align={align}\n key={getItemKey(item) ?? getItemLabel(item)}\n label={getItemLabel(item)}\n size={size}\n view={view}\n name={name}\n disabled={disabled || (!!getItemDisabled && getItemDisabled(item))}\n checked={getChecked(item)}\n onChange={({ e }) => getOnChange(item)(e)}\n className={cnRadioGroup('Item')}\n />\n ))}\n </div>\n );\n};\n\nexport const RadioGroup = forwardRef(RadioGroupRender) as RadioGroupComponent;\n\nexport * from './types';\n"],"mappings":"8OAAA,yBAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,cAAT,iDACA,OAASC,EAAT,uBACA,OAASC,KAAT,sBACA,OAASC,kBAAT,gBACA,OAEEC,0BAFF,CAGEC,qBAHF,CAIEC,qBAJF,CAKEC,0BALF,eASA,MAAO,IAAMC,aAAY,CAAGP,EAAE,CAAC,YAAD,CAAvB,CAEP,GAAMQ,iBAAgB,CAAG,SACvBC,CADuB,CAEvBC,CAFuB,CAGpB,OAgBCR,kBAAkB,CAACO,CAAD,CAhBnB,KAEDE,KAFC,CAEDA,CAFC,YAEO,IAFP,GAGDC,CAHC,GAGDA,KAHC,CAIDC,CAJC,GAIDA,YAJC,CAKDC,CALC,GAKDA,UALC,CAMDC,CANC,GAMDA,eANC,CAODC,CAPC,GAODA,QAPC,CAQDC,CARC,GAQDA,IARC,KASDC,SATC,CASDA,CATC,YASWf,0BATX,OAUDgB,IAVC,CAUDA,CAVC,YAUMf,qBAVN,OAWDgB,IAXC,CAWDA,CAXC,YAWMf,qBAXN,OAYDgB,KAZC,CAYDA,CAZC,YAYOf,0BAZP,OAaDgB,QAbC,CAcDC,CAdC,GAcDA,SAdC,CAeEC,CAfF,yCAkBi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ropGetItemDisabled, RadioGroupPropGetItemLabel, RadioGroupProps } from './types';
|
|
2
|
+
import { RadioGroupDefaultItem, RadioGroupPropGetItemDisabled, RadioGroupPropGetItemKey, RadioGroupPropGetItemLabel, RadioGroupProps } from './types';
|
|
3
3
|
export declare const withDefaultGetters: (props: RadioGroupProps) => {
|
|
4
|
+
getItemKey: RadioGroupPropGetItemKey<RadioGroupDefaultItem>;
|
|
4
5
|
getItemLabel: RadioGroupPropGetItemLabel<RadioGroupDefaultItem>;
|
|
5
6
|
getItemDisabled: RadioGroupPropGetItemDisabled<RadioGroupDefaultItem>;
|
|
6
7
|
align?: "center" | "top" | undefined;
|
|
@@ -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}var defaultGetItemLabel=function(a){return a.label},defaultGetItemDisabled=function(a){return a.disabled};export var withDefaultGetters=function(a){return _objectSpread(_objectSpread({},a),{},{getItemLabel:a.getItemLabel||defaultGetItemLabel,getItemDisabled:a.getItemDisabled||defaultGetItemDisabled})};
|
|
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}var defaultGetItemKey=function(a){return a.key},defaultGetItemLabel=function(a){return a.label},defaultGetItemDisabled=function(a){return a.disabled};export var withDefaultGetters=function(a){return _objectSpread(_objectSpread({},a),{},{getItemKey:a.getItemKey||defaultGetItemKey,getItemLabel:a.getItemLabel||defaultGetItemLabel,getItemDisabled:a.getItemDisabled||defaultGetItemDisabled})};
|
|
2
2
|
//# sourceMappingURL=helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","names":["
|
|
1
|
+
{"version":3,"file":"helper.js","names":["defaultGetItemKey","item","key","defaultGetItemLabel","label","defaultGetItemDisabled","disabled","withDefaultGetters","props","getItemKey","getItemLabel","getItemDisabled"],"sources":["../../../../../src/components/RadioGroup/helper.ts"],"sourcesContent":["import {\n RadioGroupDefaultItem,\n RadioGroupPropGetItemDisabled,\n RadioGroupPropGetItemKey,\n RadioGroupPropGetItemLabel,\n RadioGroupProps,\n} from './types';\n\nconst defaultGetItemKey: RadioGroupPropGetItemKey<RadioGroupDefaultItem> = (\n item,\n) => item.key;\nconst defaultGetItemLabel: RadioGroupPropGetItemLabel<RadioGroupDefaultItem> = (\n item,\n) => item.label;\nconst defaultGetItemDisabled: RadioGroupPropGetItemDisabled<\n RadioGroupDefaultItem\n> = (item) => item.disabled;\n\nexport const withDefaultGetters = (props: RadioGroupProps) => ({\n ...props,\n getItemKey: props.getItemKey || defaultGetItemKey,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemDisabled: props.getItemDisabled || defaultGetItemDisabled,\n});\n"],"mappings":"wqBAQMA,kBAAkE,CAAG,SACzEC,CADyE,QAEtEA,EAAI,CAACC,GAFiE,C,CAGrEC,mBAAsE,CAAG,SAC7EF,CAD6E,QAE1EA,EAAI,CAACG,KAFqE,C,CAGzEC,sBAEL,CAAG,SAACJ,CAAD,QAAUA,EAAI,CAACK,QAAf,C,CAEJ,MAAO,IAAMC,mBAAkB,CAAG,SAACC,CAAD,wCAC7BA,CAD6B,MAEhCC,UAAU,CAAED,CAAK,CAACC,UAAN,EAAoBT,iBAFA,CAGhCU,YAAY,CAAEF,CAAK,CAACE,YAAN,EAAsBP,mBAHJ,CAIhCQ,eAAe,CAAEH,CAAK,CAACG,eAAN,EAAyBN,sBAJV,GAA3B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
|
|
3
3
|
export declare type RadioGroupDefaultItem = {
|
|
4
|
+
key?: string | number;
|
|
4
5
|
label: string;
|
|
5
6
|
disabled?: boolean;
|
|
6
7
|
};
|
|
@@ -16,12 +17,14 @@ export declare const radioGroupDefaultView: RadioGroupPropView;
|
|
|
16
17
|
export declare const radioGroupPropAlign: readonly ["center", "top"];
|
|
17
18
|
export declare type RadioGroupPropAlign = typeof radioGroupPropAlign[number];
|
|
18
19
|
export declare const radioGroupPropAlignDefault: RadioGroupPropAlign;
|
|
20
|
+
export declare type RadioGroupPropGetItemKey<ITEM> = (item: ITEM) => string | number | undefined;
|
|
19
21
|
export declare type RadioGroupPropGetItemLabel<ITEM> = (item: ITEM) => string;
|
|
20
22
|
export declare type RadioGroupPropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;
|
|
21
23
|
export declare type RadioGroupProps<ITEM = RadioGroupDefaultItem> = PropsWithHTMLAttributesAndRef<{
|
|
22
24
|
align?: RadioGroupPropAlign;
|
|
23
25
|
value?: ITEM | null;
|
|
24
26
|
items: ITEM[];
|
|
27
|
+
getItemKey?: RadioGroupPropGetItemKey<ITEM>;
|
|
25
28
|
getItemLabel?: RadioGroupPropGetItemLabel<ITEM>;
|
|
26
29
|
getItemDisabled?: RadioGroupPropGetItemDisabled<ITEM>;
|
|
27
30
|
onChange: (props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["radioGroupDirections","radioGroupDefaultDirection","radioGroupSizes","radioGroupDefaultSize","radioGroupViews","radioGroupDefaultView","radioGroupPropAlign","radioGroupPropAlignDefault"],"sources":["../../../../../src/components/RadioGroup/types.ts"],"sourcesContent":["import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\n\nexport type RadioGroupDefaultItem = {\n label: string;\n disabled?: boolean;\n};\n\nexport const radioGroupDirections = ['column', 'row'] as const;\nexport type RadioGroupDirection = typeof radioGroupDirections[number];\nexport const radioGroupDefaultDirection: RadioGroupDirection =\n radioGroupDirections[0];\n\nexport const radioGroupSizes = ['m', 'l', 'xs', 's'] as const;\nexport type RadioGroupPropSize = typeof radioGroupSizes[number];\nexport const radioGroupDefaultSize: RadioGroupPropSize = radioGroupSizes[0];\n\nexport const radioGroupViews = ['primary', 'ghost'] as const;\nexport type RadioGroupPropView = typeof radioGroupViews[number];\nexport const radioGroupDefaultView: RadioGroupPropView = radioGroupViews[0];\n\nexport const radioGroupPropAlign = ['center', 'top'] as const;\nexport type RadioGroupPropAlign = typeof radioGroupPropAlign[number];\nexport const radioGroupPropAlignDefault: RadioGroupPropAlign =\n radioGroupPropAlign[0];\n\nexport type RadioGroupPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type RadioGroupPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\n\nexport type RadioGroupProps<ITEM = RadioGroupDefaultItem> =\n PropsWithHTMLAttributesAndRef<\n {\n align?: RadioGroupPropAlign;\n value?: ITEM | null;\n items: ITEM[];\n getItemLabel?: RadioGroupPropGetItemLabel<ITEM>;\n getItemDisabled?: RadioGroupPropGetItemDisabled<ITEM>;\n onChange: (props: {\n e: React.ChangeEvent<HTMLInputElement>;\n value: ITEM;\n }) => void;\n name?: string;\n direction?: RadioGroupDirection;\n size?: RadioGroupPropSize;\n view?: RadioGroupPropView;\n disabled?: boolean;\n className?: string;\n },\n HTMLDivElement\n > &\n (ITEM extends { label: RadioGroupDefaultItem['label'] }\n ? {}\n : {\n getItemLabel: RadioGroupPropGetItemLabel<ITEM>;\n });\n\nexport type RadioGroupComponent = <ITEM = RadioGroupDefaultItem>(\n props: RadioGroupProps<ITEM>,\n) => React.ReactElement | null;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","names":["radioGroupDirections","radioGroupDefaultDirection","radioGroupSizes","radioGroupDefaultSize","radioGroupViews","radioGroupDefaultView","radioGroupPropAlign","radioGroupPropAlignDefault"],"sources":["../../../../../src/components/RadioGroup/types.ts"],"sourcesContent":["import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\n\nexport type RadioGroupDefaultItem = {\n key?: string | number;\n label: string;\n disabled?: boolean;\n};\n\nexport const radioGroupDirections = ['column', 'row'] as const;\nexport type RadioGroupDirection = typeof radioGroupDirections[number];\nexport const radioGroupDefaultDirection: RadioGroupDirection =\n radioGroupDirections[0];\n\nexport const radioGroupSizes = ['m', 'l', 'xs', 's'] as const;\nexport type RadioGroupPropSize = typeof radioGroupSizes[number];\nexport const radioGroupDefaultSize: RadioGroupPropSize = radioGroupSizes[0];\n\nexport const radioGroupViews = ['primary', 'ghost'] as const;\nexport type RadioGroupPropView = typeof radioGroupViews[number];\nexport const radioGroupDefaultView: RadioGroupPropView = radioGroupViews[0];\n\nexport const radioGroupPropAlign = ['center', 'top'] as const;\nexport type RadioGroupPropAlign = typeof radioGroupPropAlign[number];\nexport const radioGroupPropAlignDefault: RadioGroupPropAlign =\n radioGroupPropAlign[0];\n\nexport type RadioGroupPropGetItemKey<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\nexport type RadioGroupPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type RadioGroupPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\n\nexport type RadioGroupProps<ITEM = RadioGroupDefaultItem> =\n PropsWithHTMLAttributesAndRef<\n {\n align?: RadioGroupPropAlign;\n value?: ITEM | null;\n items: ITEM[];\n getItemKey?: RadioGroupPropGetItemKey<ITEM>;\n getItemLabel?: RadioGroupPropGetItemLabel<ITEM>;\n getItemDisabled?: RadioGroupPropGetItemDisabled<ITEM>;\n onChange: (props: {\n e: React.ChangeEvent<HTMLInputElement>;\n value: ITEM;\n }) => void;\n name?: string;\n direction?: RadioGroupDirection;\n size?: RadioGroupPropSize;\n view?: RadioGroupPropView;\n disabled?: boolean;\n className?: string;\n },\n HTMLDivElement\n > &\n (ITEM extends { label: RadioGroupDefaultItem['label'] }\n ? {}\n : {\n getItemLabel: RadioGroupPropGetItemLabel<ITEM>;\n });\n\nexport type RadioGroupComponent = <ITEM = RadioGroupDefaultItem>(\n props: RadioGroupProps<ITEM>,\n) => React.ReactElement | null;\n"],"mappings":"AAQA,MAAO,IAAMA,qBAAoB,CAAG,CAAC,QAAD,CAAW,KAAX,CAA7B,CAEP,MAAO,IAAMC,2BAA+C,CAC1DD,oBAAoB,CAAC,CAAD,CADf,CAGP,MAAO,IAAME,gBAAe,CAAG,CAAC,GAAD,CAAM,GAAN,CAAW,IAAX,CAAiB,GAAjB,CAAxB,CAEP,MAAO,IAAMC,sBAAyC,CAAGD,eAAe,CAAC,CAAD,CAAjE,CAEP,MAAO,IAAME,gBAAe,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAxB,CAEP,MAAO,IAAMC,sBAAyC,CAAGD,eAAe,CAAC,CAAD,CAAjE,CAEP,MAAO,IAAME,oBAAmB,CAAG,CAAC,QAAD,CAAW,KAAX,CAA5B,CAEP,MAAO,IAAMC,2BAA+C,CAC1DD,mBAAmB,CAAC,CAAD,CADd"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";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"];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,useMemo,useRef}from"react";import{Transition}from"react-transition-group";import{cnListBox,ListItem,mapVerticalSpase}from"../../ListCanary";import{cnMixSpace}from"../../../mixs/MixSpace";import{isOptionForCreate,isOptionForSelectAll}from"../../../hooks/useSelect/useSelect";import{animateTimeout,cnMixPopoverAnimate}from"../../../mixs/MixPopoverAnimate/MixPopoverAnimate";import{cn}from"../../../utils/bem";import{fabricIndex}from"../../../utils/fabricIndex";import{Popover}from"../../Popover/Popover";import{SelectCreateButton}from"../SelectCreateButton/SelectCreateButton";import{SelectGroupLabel}from"../SelectGroupLabel/SelectGroupLabel";import{SelectItemAll}from"../SelectItemAll/SelectSelectAll";import{SelectLoader}from"../SelectLoader/SelectLoader";export var selectDropdownform=["default","brick","round"];export var defaultSelectDropdownPropForm=selectDropdownform[0];var cnSelectDropdown=cn("SelectDropdown");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=_objectWithoutProperties(a,_excluded),v="round"===l?"increased":"normal",w=useRef(null),x=useMemo(function(){return 0<q.filter(function(a){return isOptionForCreate(a)||Array.isArray(a.items)&&0<a.items.length}).length},[q]),y="none"===o?void 0:o;return React.createElement(Transition,{in:m,unmountOnExit:!0,nodeRef:w,timeout:animateTimeout},function(a){var j=fabricIndex(-1);return React.createElement(Popover,Object.assign({},u,{anchorRef:b,direction:"downStartLeft",possibleDirections:["downStartLeft","upStartLeft","downStartRight","upStartRight"],offset:y,ref:w,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("List",[cnMixSpace({pV:mapVerticalSpase[c]})]),ref:e},r&&React.createElement(SelectLoader,{mode:x?"blur":"empty"}),q.map(function(a){return isOptionForCreate(a)?React.createElement(SelectCreateButton,Object.assign({size:c,labelForCreate:f,inputValue:a.label,indent:v},d({index:j(),item:a}))):React.createElement(Fragment,{key:a.key},a.group&&s&&React.createElement(SelectGroupLabel,{label:s(a.group),size:c,indent:v}),a.items.map(function(b,e){return isOptionForSelectAll(b)?React.createElement(SelectItemAll,Object.assign({indent:v,size:c},d({index:j(),item:b}),{intermediate:!!(b.checkedCount&&b.totalCount)&&b.checkedCount!==b.totalCount,checked:b.checkedCount===b.totalCount,countItems:b.checkedCount,total:b.totalCount})):React.createElement(Fragment,{key:"".concat(a.key,"-").concat(e)},p(_objectSpread({item:b},d({index:j(),item:b}))))}))}),!r&&k&&t&&h&&React.createElement(ListItem,{size:c,label:h,innerOffset:v},h),!r&&!k&&i&&React.createElement(ListItem,{size:c,label:
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";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"];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,useMemo,useRef}from"react";import{Transition}from"react-transition-group";import{cnListBox,ListItem,mapVerticalSpase}from"../../ListCanary";import{cnMixSpace}from"../../../mixs/MixSpace";import{isOptionForCreate,isOptionForSelectAll}from"../../../hooks/useSelect/useSelect";import{animateTimeout,cnMixPopoverAnimate}from"../../../mixs/MixPopoverAnimate/MixPopoverAnimate";import{cn}from"../../../utils/bem";import{fabricIndex}from"../../../utils/fabricIndex";import{Popover}from"../../Popover/Popover";import{SelectCreateButton}from"../SelectCreateButton/SelectCreateButton";import{SelectGroupLabel}from"../SelectGroupLabel/SelectGroupLabel";import{SelectItemAll}from"../SelectItemAll/SelectSelectAll";import{SelectLoader}from"../SelectLoader/SelectLoader";export var selectDropdownform=["default","brick","round"];export var defaultSelectDropdownPropForm=selectDropdownform[0];var cnSelectDropdown=cn("SelectDropdown");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=_objectWithoutProperties(a,_excluded),v="round"===l?"increased":"normal",w=useRef(null),x=useMemo(function(){return 0<q.filter(function(a){return isOptionForCreate(a)||Array.isArray(a.items)&&0<a.items.length}).length},[q]),y="none"===o?void 0:o;return React.createElement(Transition,{in:m,unmountOnExit:!0,nodeRef:w,timeout:animateTimeout},function(a){var j=fabricIndex(-1);return React.createElement(Popover,Object.assign({},u,{anchorRef:b,direction:"downStartLeft",possibleDirections:["downStartLeft","upStartLeft","downStartRight","upStartRight"],offset:y,ref:w,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("List",[cnMixSpace({pV:mapVerticalSpase[c]})]),ref:e},r&&React.createElement(SelectLoader,{mode:x?"blur":"empty"}),q.map(function(a){return isOptionForCreate(a)?React.createElement(SelectCreateButton,Object.assign({size:c,labelForCreate:f,inputValue:a.label,indent:v},d({index:j(),item:a}))):React.createElement(Fragment,{key:a.key},a.group&&s&&React.createElement(SelectGroupLabel,{label:s(a.group),size:c,indent:v}),a.items.map(function(b,e){return isOptionForSelectAll(b)?React.createElement(SelectItemAll,Object.assign({indent:v,size:c},d({index:j(),item:b}),{intermediate:!!(b.checkedCount&&b.totalCount)&&b.checkedCount!==b.totalCount,checked:b.checkedCount===b.totalCount,countItems:b.checkedCount,total:b.totalCount})):React.createElement(Fragment,{key:"".concat(a.key,"-").concat(e)},p(_objectSpread({item:b},d({index:j(),item:b}))))}))}),!r&&k&&t&&h&&React.createElement(ListItem,{size:c,label:h,innerOffset:v},h),!r&&!k&&i&&React.createElement(ListItem,{size:c,label:i,innerOffset:v},i)))})};
|
|
2
2
|
//# sourceMappingURL=SelectDropdown.js.map
|