@consta/uikit 4.12.0 → 4.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__internal__/src/components/Breadcrumbs/BreadcrumbsItem/BreadcrumbsItem.js +1 -1
- package/__internal__/src/components/Breadcrumbs/BreadcrumbsItem/BreadcrumbsItem.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/BreadcrumbsDeprecated/BreadcrumbsDeprecated.js +1 -1
- package/__internal__/src/components/BreadcrumbsDeprecated/BreadcrumbsDeprecated.js.map +1 -1
- package/__internal__/src/components/CalendarDeprecated/CalendarMonthToggler/CalendarMonthToggler.js +1 -1
- package/__internal__/src/components/CalendarDeprecated/CalendarMonthToggler/CalendarMonthToggler.js.map +1 -1
- package/__internal__/src/components/CalendarDeprecated/CalendarSlider/CalendarSlider.js +1 -1
- package/__internal__/src/components/CalendarDeprecated/CalendarSlider/CalendarSlider.js.map +1 -1
- package/__internal__/src/components/Collapse/Collapse.css +1 -1
- package/__internal__/src/components/Collapse/Collapse.d.ts +1 -2
- package/__internal__/src/components/Collapse/Collapse.js +1 -1
- package/__internal__/src/components/Collapse/Collapse.js.map +1 -1
- package/__internal__/src/components/Collapse/CollapseIcon/CollapseIcon.css +1 -1
- package/__internal__/src/components/Collapse/CollapseIcon/CollapseIcon.js +1 -1
- package/__internal__/src/components/Collapse/CollapseIcon/CollapseIcon.js.map +1 -1
- package/__internal__/src/components/Collapse/types.d.ts +7 -2
- package/__internal__/src/components/Collapse/types.js +1 -1
- package/__internal__/src/components/Collapse/types.js.map +1 -1
- package/__internal__/src/components/CollapseGroup/CollapseGroup.js +1 -1
- package/__internal__/src/components/CollapseGroup/CollapseGroup.js.map +1 -1
- package/__internal__/src/components/CollapseGroup/helpers.d.ts +7 -4
- package/__internal__/src/components/CollapseGroup/helpers.js.map +1 -1
- package/__internal__/src/components/CollapseGroup/useChoice.js +1 -1
- package/__internal__/src/components/CollapseGroup/useChoice.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerDropdown/DatePickerDropdown.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerDropdown/DatePickerDropdown.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDate/DatePickerTypeDate.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDate/DatePickerTypeDate.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateRange/DatePickerTypeDateRange.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateRange/DatePickerTypeDateRange.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateTime/DatePickerTypeDateTime.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateTime/DatePickerTypeDateTime.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeMonth/DatePickerTypeMonth.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeMonth/DatePickerTypeMonth.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeMonthRange/DatePickerTypeMonthRange.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeMonthRange/DatePickerTypeMonthRange.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeTime/DatePickerTypeTime.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeTime/DatePickerTypeTime.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeYear/DatePickerTypeYear.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeYear/DatePickerTypeYear.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeYearRange/DatePickerTypeYearRange.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeYearRange/DatePickerTypeYearRange.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeSlider/DateTimeSlider.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeSlider/DateTimeSlider.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeToggler/DateTimeToggler.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeToggler/DateTimeToggler.js.map +1 -1
- package/__internal__/src/components/Pagination/Pagination.js +1 -1
- package/__internal__/src/components/Pagination/Pagination.js.map +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBar.js +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBar.js.map +1 -1
- package/__internal__/src/components/Responses403/Responses403.js +1 -1
- package/__internal__/src/components/Responses403/Responses403.js.map +1 -1
- package/__internal__/src/components/Responses404/Responses404.js +1 -1
- package/__internal__/src/components/Responses404/Responses404.js.map +1 -1
- package/__internal__/src/components/ResponsesDeleted/ResponsesDeleted.js +1 -1
- package/__internal__/src/components/ResponsesDeleted/ResponsesDeleted.js.map +1 -1
- package/__internal__/src/components/ResponsesEmptyBox/ResponsesEmptyBox.js +1 -1
- package/__internal__/src/components/ResponsesEmptyBox/ResponsesEmptyBox.js.map +1 -1
- package/__internal__/src/components/ResponsesEmptyPockets/ResponsesEmptyPockets.js +1 -1
- package/__internal__/src/components/ResponsesEmptyPockets/ResponsesEmptyPockets.js.map +1 -1
- package/__internal__/src/components/ResponsesExit/ResponsesExit.js +1 -1
- package/__internal__/src/components/ResponsesExit/ResponsesExit.js.map +1 -1
- package/__internal__/src/components/ResponsesNothingFound/ResponsesNothingFound.js +1 -1
- package/__internal__/src/components/ResponsesNothingFound/ResponsesNothingFound.js.map +1 -1
- package/__internal__/src/components/SnackBar/SnackBarActionButton/SnackBarActionButton.js +1 -1
- package/__internal__/src/components/SnackBar/SnackBarActionButton/SnackBarActionButton.js.map +1 -1
- package/__internal__/src/components/SnackBar/SnackBarItem/SnackBarItem.js +1 -1
- package/__internal__/src/components/SnackBar/SnackBarItem/SnackBarItem.js.map +1 -1
- package/__internal__/src/components/Steps/Steps.js +1 -1
- package/__internal__/src/components/Steps/Steps.js.map +1 -1
- package/__internal__/src/components/Table/FilterContainer/TableFilterContainer.js +1 -1
- package/__internal__/src/components/Table/FilterContainer/TableFilterContainer.js.map +1 -1
- package/__internal__/src/components/Table/FilterTooltip/TableFilterTooltip.js +1 -1
- package/__internal__/src/components/Table/FilterTooltip/TableFilterTooltip.js.map +1 -1
- package/__internal__/src/components/Table/Header/TableHeader.js +1 -1
- package/__internal__/src/components/Table/Header/TableHeader.js.map +1 -1
- package/__internal__/src/components/Table/RowsCollapse/TableRowsCollapse.js +1 -1
- package/__internal__/src/components/Table/RowsCollapse/TableRowsCollapse.js.map +1 -1
- package/__internal__/src/components/Table/TextFilter/TableTextFilter.js +1 -1
- package/__internal__/src/components/Table/TextFilter/TableTextFilter.js.map +1 -1
- package/__internal__/src/components/Tabs/FitModeScrollWrapper/TabsFitModeScrollWrapper.js +1 -1
- package/__internal__/src/components/Tabs/FitModeScrollWrapper/TabsFitModeScrollWrapper.js.map +1 -1
- package/__internal__/src/components/Tabs/MoreItems/TabsMoreItems.js +1 -1
- package/__internal__/src/components/Tabs/MoreItems/TabsMoreItems.js.map +1 -1
- package/__internal__/src/components/TabsDeprecated/FitModeScrollWrapper/TabsFitModeScrollWrapper.js +1 -1
- package/__internal__/src/components/TabsDeprecated/FitModeScrollWrapper/TabsFitModeScrollWrapper.js.map +1 -1
- package/__internal__/src/components/TabsDeprecated/MoreItems/TabsMoreItems.js +1 -1
- package/__internal__/src/components/TabsDeprecated/MoreItems/TabsMoreItems.js.map +1 -1
- package/__internal__/src/components/ThemeToggler/ThemeToggler.js +1 -1
- package/__internal__/src/components/ThemeToggler/ThemeToggler.js.map +1 -1
- package/__internal__/src/components/ThemeToggler/helpers.d.ts +1 -0
- package/__internal__/src/components/ThemeToggler/types.d.ts +4 -2
- package/__internal__/src/components/ThemeToggler/types.js.map +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
- package/__internal__/src/components/DatePicker/useDropdownVisible.d.ts +0 -24
- package/__internal__/src/components/DatePicker/useDropdownVisible.js +0 -2
- package/__internal__/src/components/DatePicker/useDropdownVisible.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"User.js","names":["IconSelect","React","cn","getByMap","forwardRefWithAs","Avatar","Button","Text","userPropSize","userPropSizeDefault","userPropView","userPropViewDefault","userPropWidth","userPropWidthDefault","userPropStatus","cnUser","infoSizeMap","s","m","l","iconSizeMap","avatarSizeMap","buttonSizeMap","User","props","ref","as","className","size","avatarUrl","name","view","width","propOnlyAvatar","onlyAvatar","withArrow","iconRight","onIconRightClick","info","status","otherProps","IconRight","minified"],"sources":["../../../../../src/components/User/User.tsx"],"sourcesContent":["import './User.css';\n\nimport { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport { IconSelect } from '@consta/icons/IconSelect';\nimport React from 'react';\n\nimport { cn } from '../../utils/bem';\nimport { getByMap } from '../../utils/getByMap';\nimport { forwardRefWithAs } from '../../utils/types/PropsWithAsAttributes';\nimport { Avatar } from '../Avatar/Avatar';\nimport { Button, ButtonPropSize } from '../Button/Button';\nimport { Text, TextPropSize } from '../Text/Text';\n\nexport const userPropSize = ['m', 's', 'l'] as const;\nexport type UserPropSize = typeof userPropSize[number];\nexport const userPropSizeDefault: UserPropSize = userPropSize[0];\n\nexport const userPropView = ['clear', 'ghost'] as const;\nexport type UserPropView = typeof userPropView[number];\nexport const userPropViewDefault: UserPropView = userPropView[0];\n\nexport const userPropWidth = ['default', 'full'] as const;\nexport type UserPropWidth = typeof userPropWidth[number];\nexport const userPropWidthDefault: UserPropWidth = userPropWidth[0];\n\nexport const userPropStatus = ['available', 'remote', 'out'] as const;\nexport type UserPropStatus = typeof userPropStatus[number];\n\ntype Props = {\n avatarUrl?: string;\n name?: string;\n size?: UserPropSize;\n view?: UserPropView;\n width?: UserPropWidth;\n status?: UserPropStatus;\n onlyAvatar?: boolean;\n info?: string;\n children?: never;\n} & (\n | {\n withArrow?: boolean;\n iconRight?: never;\n onIconRightClick?: never;\n }\n | {\n withArrow?: never;\n iconRight?: IconComponent;\n onIconRightClick?: (e: React.SyntheticEvent) => void;\n }\n);\n\nexport const cnUser = cn('User');\n\nconst infoSizeMap: Record<UserPropSize, TextPropSize> = {\n s: '2xs',\n m: '2xs',\n l: 'xs',\n};\n\nconst iconSizeMap: Record<UserPropSize, IconPropSize> = {\n s: 'xs',\n m: 'xs',\n l: 's',\n};\n\nconst avatarSizeMap: Record<UserPropSize, IconPropSize> = {\n s: 'xs',\n m: 's',\n l: 'm',\n};\n\nconst buttonSizeMap: Record<UserPropSize, ButtonPropSize> = {\n s: 'xs',\n m: 'xs',\n l: 's',\n};\n\nexport const User = forwardRefWithAs<Props>((props, ref) => {\n const {\n as = 'div',\n className,\n size = userPropSizeDefault,\n avatarUrl,\n name,\n view = userPropViewDefault,\n width = userPropWidthDefault,\n onlyAvatar: propOnlyAvatar,\n withArrow,\n iconRight,\n onIconRightClick,\n info,\n status,\n ...otherProps\n } = props;\n const Tag = as as string;\n const onlyAvatar = propOnlyAvatar || (!name && !info);\n const IconRight = iconRight;\n\n return (\n <Tag\n {...otherProps}\n className={cnUser(\n { size, view, width, withArrow, minified: onlyAvatar },\n [className],\n )}\n ref={ref}\n >\n <div className={cnUser('AvatarWrapper', { status })}>\n <Avatar\n size={getByMap(avatarSizeMap, size)}\n url={avatarUrl}\n name={name}\n />\n </div>\n {!onlyAvatar && (name || info) && (\n <div className={cnUser('Block')}>\n {name && (\n <Text\n className={cnUser('Name')}\n size={size}\n view=\"primary\"\n lineHeight=\"2xs\"\n >\n {name}\n </Text>\n )}\n {info && size !== 's' && (\n <Text\n className={cnUser('Info')}\n size={getByMap(infoSizeMap, size)}\n view=\"secondary\"\n lineHeight=\"2xs\"\n >\n {info}\n </Text>\n )}\n </div>\n )}\n {withArrow && (\n <IconSelect\n className={cnUser('Icon')}\n size={getByMap(iconSizeMap, size)}\n view=\"secondary\"\n />\n )}\n {IconRight && !onIconRightClick && (\n <IconRight\n className={cnUser('Icon')}\n size={getByMap(iconSizeMap, size)}\n view=\"secondary\"\n />\n )}\n {IconRight && onIconRightClick && (\n <Button\n className={cnUser('IconRightButton')}\n onClick={onIconRightClick}\n iconRight={IconRight}\n onlyIcon\n view=\"clear\"\n size={getByMap(buttonSizeMap, size)}\n form=\"round\"\n />\n )}\n </Tag>\n );\n});\n"],"mappings":"uOAAA,mBAGA,OAASA,UAAT,KAA2B,0BAA3B,CACA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,uBACA,OAASC,QAAT,4BACA,OAASC,gBAAT,+CACA,OAASC,MAAT,wBACA,OAASC,MAAT,wBACA,OAASC,IAAT,oBAEA,MAAO,IAAMC,aAAY,CAAG,CAAC,GAAD,CAAM,GAAN,CAAW,GAAX,CAArB,CAEP,MAAO,IAAMC,oBAAiC,CAAGD,YAAY,CAAC,CAAD,CAAtD,CAEP,MAAO,IAAME,aAAY,CAAG,CAAC,OAAD,CAAU,OAAV,CAArB,CAEP,MAAO,IAAMC,oBAAiC,CAAGD,YAAY,CAAC,CAAD,CAAtD,CAEP,MAAO,IAAME,cAAa,CAAG,CAAC,SAAD,CAAY,MAAZ,CAAtB,CAEP,MAAO,IAAMC,qBAAmC,CAAGD,aAAa,CAAC,CAAD,CAAzD,CAEP,MAAO,IAAME,eAAc,CAAG,CAAC,WAAD,CAAc,QAAd,CAAwB,KAAxB,CAAvB,CA0BP,MAAO,IAAMC,OAAM,CAAGb,EAAE,CAAC,MAAD,CAAjB,C,GAEDc,YAA+C,CAAG,CACtDC,CAAC,CAAE,KADmD,CAEtDC,CAAC,CAAE,KAFmD,CAGtDC,CAAC,CAAE,IAHmD,C,CAMlDC,WAA+C,CAAG,CACtDH,C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nB,CAEE,IAAI,CAAEZ,QAAQ,CAACiB,WAAD,CAAcQ,CAAd,CAFhB,CAGE,IAAI,CAAC,WAHP,EA/CJ,CAqDGa,CAAS,EAAIJ,CAAb,EACC,oBAAC,MAAD,EACE,SAAS,CAAEtB,MAAM,CAAC,iBAAD,CADnB,CAEE,OAAO,CAAEsB,CAFX,CAGE,SAAS,CAAEI,CAHb,CAIE,QAAQ,GAJV,CAKE,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"User.js","names":["IconSelect","React","cn","getByMap","forwardRefWithAs","Avatar","Button","Text","userPropSize","userPropSizeDefault","userPropView","userPropViewDefault","userPropWidth","userPropWidthDefault","userPropStatus","cnUser","infoSizeMap","s","m","l","iconSizeMap","avatarSizeMap","buttonSizeMap","User","props","ref","as","className","size","avatarUrl","name","view","width","propOnlyAvatar","onlyAvatar","withArrow","iconRight","onIconRightClick","info","status","otherProps","IconRight","minified"],"sources":["../../../../../src/components/User/User.tsx"],"sourcesContent":["import './User.css';\n\nimport { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport { IconSelect } from '@consta/icons/IconSelect';\nimport React from 'react';\n\nimport { cn } from '../../utils/bem';\nimport { getByMap } from '../../utils/getByMap';\nimport { forwardRefWithAs } from '../../utils/types/PropsWithAsAttributes';\nimport { Avatar } from '../Avatar/Avatar';\nimport { Button, ButtonPropSize } from '../Button/Button';\nimport { Text, TextPropSize } from '../Text/Text';\n\nexport const userPropSize = ['m', 's', 'l'] as const;\nexport type UserPropSize = typeof userPropSize[number];\nexport const userPropSizeDefault: UserPropSize = userPropSize[0];\n\nexport const userPropView = ['clear', 'ghost'] as const;\nexport type UserPropView = typeof userPropView[number];\nexport const userPropViewDefault: UserPropView = userPropView[0];\n\nexport const userPropWidth = ['default', 'full'] as const;\nexport type UserPropWidth = typeof userPropWidth[number];\nexport const userPropWidthDefault: UserPropWidth = userPropWidth[0];\n\nexport const userPropStatus = ['available', 'remote', 'out'] as const;\nexport type UserPropStatus = typeof userPropStatus[number];\n\ntype Props = {\n avatarUrl?: string;\n name?: string;\n size?: UserPropSize;\n view?: UserPropView;\n width?: UserPropWidth;\n status?: UserPropStatus;\n onlyAvatar?: boolean;\n info?: string;\n children?: never;\n} & (\n | {\n withArrow?: boolean;\n iconRight?: never;\n onIconRightClick?: never;\n }\n | {\n withArrow?: never;\n iconRight?: IconComponent;\n onIconRightClick?: (e: React.SyntheticEvent) => void;\n }\n);\n\nexport const cnUser = cn('User');\n\nconst infoSizeMap: Record<UserPropSize, TextPropSize> = {\n s: '2xs',\n m: '2xs',\n l: 'xs',\n};\n\nconst iconSizeMap: Record<UserPropSize, IconPropSize> = {\n s: 'xs',\n m: 'xs',\n l: 's',\n};\n\nconst avatarSizeMap: Record<UserPropSize, IconPropSize> = {\n s: 'xs',\n m: 's',\n l: 'm',\n};\n\nconst buttonSizeMap: Record<UserPropSize, ButtonPropSize> = {\n s: 'xs',\n m: 'xs',\n l: 's',\n};\n\nexport const User = forwardRefWithAs<Props>((props, ref) => {\n const {\n as = 'div',\n className,\n size = userPropSizeDefault,\n avatarUrl,\n name,\n view = userPropViewDefault,\n width = userPropWidthDefault,\n onlyAvatar: propOnlyAvatar,\n withArrow,\n iconRight,\n onIconRightClick,\n info,\n status,\n ...otherProps\n } = props;\n const Tag = as as string;\n const onlyAvatar = propOnlyAvatar || (!name && !info);\n const IconRight = iconRight;\n\n return (\n <Tag\n {...otherProps}\n className={cnUser(\n { size, view, width, withArrow, minified: onlyAvatar },\n [className],\n )}\n ref={ref}\n >\n <div className={cnUser('AvatarWrapper', { status })}>\n <Avatar\n size={getByMap(avatarSizeMap, size)}\n url={avatarUrl}\n name={name}\n />\n </div>\n {!onlyAvatar && (name || info) && (\n <div className={cnUser('Block')}>\n {name && (\n <Text\n className={cnUser('Name')}\n size={size}\n view=\"primary\"\n lineHeight=\"2xs\"\n >\n {name}\n </Text>\n )}\n {info && size !== 's' && (\n <Text\n className={cnUser('Info')}\n size={getByMap(infoSizeMap, size)}\n view=\"secondary\"\n lineHeight=\"2xs\"\n >\n {info}\n </Text>\n )}\n </div>\n )}\n {withArrow && (\n <IconSelect\n className={cnUser('Icon')}\n size={getByMap(iconSizeMap, size)}\n view=\"secondary\"\n />\n )}\n {IconRight && !onIconRightClick && (\n <IconRight\n className={cnUser('Icon')}\n size={getByMap(iconSizeMap, size)}\n view=\"secondary\"\n />\n )}\n {IconRight && onIconRightClick && (\n <Button\n className={cnUser('IconRightButton')}\n onClick={onIconRightClick}\n iconRight={IconRight}\n onlyIcon\n type=\"button\"\n view=\"clear\"\n size={getByMap(buttonSizeMap, size)}\n form=\"round\"\n />\n )}\n </Tag>\n );\n});\n"],"mappings":"uOAAA,mBAGA,OAASA,UAAT,KAA2B,0BAA3B,CACA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,uBACA,OAASC,QAAT,4BACA,OAASC,gBAAT,+CACA,OAASC,MAAT,wBACA,OAASC,MAAT,wBACA,OAASC,IAAT,oBAEA,MAAO,IAAMC,aAAY,CAAG,CAAC,GAAD,CAAM,GAAN,CAAW,GAAX,CAArB,CAEP,MAAO,IAAMC,oBAAiC,CAAGD,YAAY,CAAC,CAAD,CAAtD,CAEP,MAAO,IAAME,aAAY,CAAG,CAAC,OAAD,CAAU,OAAV,CAArB,CAEP,MAAO,IAAMC,oBAAiC,CAAGD,YAAY,CAAC,CAAD,CAAtD,CAEP,MAAO,IAAME,cAAa,CAAG,CAAC,SAAD,CAAY,MAAZ,CAAtB,CAEP,MAAO,IAAMC,qBAAmC,CAAGD,aAAa,CAAC,CAAD,CAAzD,CAEP,MAAO,IAAME,eAAc,CAAG,CAAC,WAAD,CAAc,QAAd,CAAwB,KAAxB,CAAvB,CA0BP,MAAO,IAAMC,OAAM,CAAGb,EAAE,CAAC,MAAD,CAAjB,C,GAEDc,YAA+C,CAAG,CACtDC,CAAC,CAAE,KADmD,CAEtDC,CAAC,CAAE,KAFmD,CAGtDC,CAAC,CAAE,IAHmD,C,CAMlDC,WAA+C,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CAAC,MAAD,CADnB,CAEE,IAAI,CAAEZ,QAAQ,CAACiB,WAAD,CAAcQ,CAAd,CAFhB,CAGE,IAAI,CAAC,WAHP,EA/CJ,CAqDGa,CAAS,EAAIJ,CAAb,EACC,oBAAC,MAAD,EACE,SAAS,CAAEtB,MAAM,CAAC,iBAAD,CADnB,CAEE,OAAO,CAAEsB,CAFX,CAGE,SAAS,CAAEI,CAHb,CAIE,QAAQ,GAJV,CAKE,IAAI,CAAC,QALP,CAME,IAAI,CAAC,OANP,CAOE,IAAI,CAAEtC,QAAQ,CAACmB,aAAD,CAAgBM,CAAhB,CAPhB,CAQE,IAAI,CAAC,OARP,EAtDJ,CAmEH,CAzFmC,CAA7B"}
|
package/package.json
CHANGED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare type UseDropdownVisiblePropOnFocus = [
|
|
3
|
-
React.FocusEventHandler<HTMLElement>?,
|
|
4
|
-
React.FocusEventHandler<HTMLElement>?
|
|
5
|
-
] | React.FocusEventHandler<HTMLElement>;
|
|
6
|
-
declare type FieldType = 'start' | 'end' | undefined;
|
|
7
|
-
declare type FieldResult = {
|
|
8
|
-
flag: boolean;
|
|
9
|
-
onFocus: React.FocusEventHandler<HTMLElement>;
|
|
10
|
-
onBlur: React.FocusEventHandler<HTMLElement>;
|
|
11
|
-
};
|
|
12
|
-
declare type UseDropdownVisibleResult = {
|
|
13
|
-
calendarVisible: boolean;
|
|
14
|
-
blocks: {
|
|
15
|
-
start: FieldResult;
|
|
16
|
-
end: FieldResult;
|
|
17
|
-
dropdown: FieldResult;
|
|
18
|
-
};
|
|
19
|
-
close: () => void;
|
|
20
|
-
fieldType: FieldType;
|
|
21
|
-
};
|
|
22
|
-
declare type UseDropdownVisible = (onFocus: UseDropdownVisiblePropOnFocus | undefined, onBlur?: UseDropdownVisiblePropOnFocus) => UseDropdownVisibleResult;
|
|
23
|
-
export declare const useDropdownVisible: UseDropdownVisible;
|
|
24
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{useEffect,useState}from"react";import{useFlag}from"../../hooks/useFlag";export var useDropdownVisible=function(a,b){var c=useFlag(),d=_slicedToArray(c,2),e=d[0],f=d[1],g=useState(),h=_slicedToArray(g,2),i=h[0],j=h[1],k=useFlag(!1),l=_slicedToArray(k,2),m=l[0],n=l[1],o=useFlag(),p=_slicedToArray(o,2),q=p[0],r=p[1];useEffect(function(){m||e?r.on():r.off()},[e,m]);return{calendarVisible:q,close:function close(){r.off(),f.off(),n.off()},blocks:{start:{flag:e,onFocus:function onStartFocus(b){var c;j("start"),f.on(),Array.isArray(a)?null===(c=a[0])||void 0===c?void 0:c.call(a,b):null===a||void 0===a?void 0:a(b)},onBlur:function onStartBlur(a){var c;Array.isArray(b)?null===(c=b[0])||void 0===c?void 0:c.call(b,a):null===b||void 0===b?void 0:b(a),f.off()}},end:{flag:e,onFocus:function onEndFocus(b){var c;j("end"),f.on(),Array.isArray(a)?null===(c=a[1])||void 0===c?void 0:c.call(a,b):null===a||void 0===a?void 0:a(b)},onBlur:function onEndBlur(a){var c;Array.isArray(b)?null===(c=b[1])||void 0===c?void 0:c.call(b,a):null===b||void 0===b?void 0:b(a),f.off()}},dropdown:{flag:m,onFocus:function(){return n.on()},onBlur:function(){return n.off()}}},fieldType:i}};
|
|
2
|
-
//# sourceMappingURL=useDropdownVisible.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDropdownVisible.js","names":["useEffect","useState","useFlag","useDropdownVisible","onFocus","onBlur","fieldFocused","setFieldFocused","fieldType","setFieldType","dropdownFocused","setDropdownFocused","calendarVisible","setCalendarVisible","on","off","close","blocks","start","flag","onStartFocus","e","Array","isArray","onStartBlur","end","onEndFocus","onEndBlur","dropdown"],"sources":["../../../../../src/components/DatePicker/useDropdownVisible.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { useFlag } from '##/hooks/useFlag';\n\ntype UseDropdownVisiblePropOnFocus =\n | [\n React.FocusEventHandler<HTMLElement>?,\n React.FocusEventHandler<HTMLElement>?,\n ]\n | React.FocusEventHandler<HTMLElement>;\n\ntype FieldType = 'start' | 'end' | undefined;\n\ntype FieldResult = {\n flag: boolean;\n onFocus: React.FocusEventHandler<HTMLElement>;\n onBlur: React.FocusEventHandler<HTMLElement>;\n};\n\ntype UseDropdownVisibleResult = {\n calendarVisible: boolean;\n blocks: {\n start: FieldResult;\n end: FieldResult;\n dropdown: FieldResult;\n };\n close: () => void;\n fieldType: FieldType;\n};\n\ntype UseDropdownVisible = (\n onFocus: UseDropdownVisiblePropOnFocus | undefined,\n onBlur?: UseDropdownVisiblePropOnFocus,\n) => UseDropdownVisibleResult;\n\nexport const useDropdownVisible: UseDropdownVisible = (onFocus, onBlur) => {\n const [fieldFocused, setFieldFocused] = useFlag();\n const [fieldType, setFieldType] = useState<FieldType>();\n const [dropdownFocused, setDropdownFocused] = useFlag(false);\n\n const [calendarVisible, setCalendarVisible] = useFlag();\n\n useEffect(() => {\n if (dropdownFocused || fieldFocused) {\n setCalendarVisible.on();\n } else {\n setCalendarVisible.off();\n }\n }, [fieldFocused, dropdownFocused]);\n\n const onStartFocus = (e: React.FocusEvent<HTMLElement>) => {\n setFieldType('start');\n setFieldFocused.on();\n Array.isArray(onFocus) ? onFocus[0]?.(e) : onFocus?.(e);\n };\n\n const onEndFocus = (e: React.FocusEvent<HTMLElement>) => {\n setFieldType('end');\n setFieldFocused.on();\n Array.isArray(onFocus) ? onFocus[1]?.(e) : onFocus?.(e);\n };\n\n const onStartBlur = (e: React.FocusEvent<HTMLElement>) => {\n Array.isArray(onBlur) ? onBlur[0]?.(e) : onBlur?.(e);\n setFieldFocused.off();\n };\n\n const onEndBlur = (e: React.FocusEvent<HTMLElement>) => {\n Array.isArray(onBlur) ? onBlur[1]?.(e) : onBlur?.(e);\n setFieldFocused.off();\n };\n\n const close = () => {\n setCalendarVisible.off();\n setFieldFocused.off();\n setDropdownFocused.off();\n };\n\n return {\n calendarVisible,\n close,\n blocks: {\n start: {\n flag: fieldFocused,\n onFocus: onStartFocus,\n onBlur: onStartBlur,\n },\n end: {\n flag: fieldFocused,\n onFocus: onEndFocus,\n onBlur: onEndBlur,\n },\n dropdown: {\n flag: dropdownFocused,\n onFocus: () => setDropdownFocused.on(),\n onBlur: () => setDropdownFocused.off(),\n },\n },\n fieldType,\n };\n};\n"],"mappings":"iEAAA,OAASA,SAAT,CAAoBC,QAApB,KAAoC,OAApC,CAEA,OAASC,OAAT,2BAiCA,MAAO,IAAMC,mBAAsC,CAAG,SAACC,CAAD,CAAUC,CAAV,CAAqB,OACjCH,OAAO,EAD0B,uBAClEI,CADkE,MACpDC,CADoD,QAEvCN,QAAQ,EAF+B,uBAElEO,CAFkE,MAEvDC,CAFuD,QAG3BP,OAAO,IAHoB,uBAGlEQ,CAHkE,MAGjDC,CAHiD,QAK3BT,OAAO,EALoB,uBAKlEU,CALkE,MAKjDC,CALiD,MAOzEb,SAAS,CAAC,UAAM,CACVU,CAAe,EAAIJ,CADT,CAEZO,CAAkB,CAACC,EAAnB,EAFY,CAIZD,CAAkB,CAACE,GAAnB,EAEH,CANQ,CAMN,CAACT,CAAD,CAAeI,CAAf,CANM,CAPgE,CA2CzE,MAAO,CACLE,eAAe,CAAfA,CADK,CAELI,KAAK,CARO,QAARA,MAAQ,EAAM,CAClBH,CAAkB,CAACE,GAAnB,EADkB,CAElBR,CAAe,CAACQ,GAAhB,EAFkB,CAGlBJ,CAAkB,CAACI,GAAnB,EACD,CAEM,CAGLE,MAAM,CAAE,CACNC,KAAK,CAAE,CACLC,IAAI,CAAEb,CADD,CAELF,OAAO,CAlCQ,QAAfgB,aAAe,CAACC,CAAD,CAAsC,OACzDZ,CAAY,CAAC,OAAD,CAD6C,CAEzDF,CAAe,CAACO,EAAhB,EAFyD,CAGzDQ,KAAK,CAACC,OAAN,CAAcnB,CAAd,YAAyBA,CAAO,CAAC,CA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