@consta/uikit 4.31.2 → 4.33.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/AttachmentCanary/index.d.ts +1 -0
- package/AttachmentCanary/index.js +1 -0
- package/PaginationCanary/index.d.ts +1 -0
- package/PaginationCanary/index.js +1 -0
- package/TooltipCanary/index.d.ts +1 -0
- package/TooltipCanary/index.js +1 -0
- package/__internal__/src/components/AttachmentCanary/Attachment.css +1 -0
- package/__internal__/src/components/AttachmentCanary/AttachmentCanary.d.ts +5 -0
- package/__internal__/src/components/AttachmentCanary/AttachmentCanary.js +2 -0
- package/__internal__/src/components/AttachmentCanary/AttachmentCanary.js.map +1 -0
- package/__internal__/src/components/AttachmentCanary/index.d.ts +1 -0
- package/__internal__/src/components/AttachmentCanary/index.js +2 -0
- package/__internal__/src/components/AttachmentCanary/index.js.map +1 -0
- package/__internal__/src/components/AttachmentCanary/types.d.ts +22 -0
- package/__internal__/src/components/AttachmentCanary/types.js +2 -0
- package/__internal__/src/components/AttachmentCanary/types.js.map +1 -0
- package/__internal__/src/components/BadgeGroup/BadgeGroup.css +1 -1
- package/__internal__/src/components/BadgeGroup/BadgeGroup.js +1 -1
- package/__internal__/src/components/BadgeGroup/BadgeGroup.js.map +1 -1
- package/__internal__/src/components/BookmarkTabsCanary/BookmarkTabsCanary.js +1 -1
- package/__internal__/src/components/BookmarkTabsCanary/BookmarkTabsCanary.js.map +1 -1
- package/__internal__/src/components/BookmarkTabsCanary/BookmarkTabsTab/BookmarkTabsTab.css +1 -1
- package/__internal__/src/components/BookmarkTabsCanary/BookmarkTabsTab/BookmarkTabsTab.js +1 -1
- package/__internal__/src/components/BookmarkTabsCanary/BookmarkTabsTab/BookmarkTabsTab.js.map +1 -1
- package/__internal__/src/components/BookmarkTabsCanary/types.d.ts +2 -2
- package/__internal__/src/components/BookmarkTabsCanary/types.js.map +1 -1
- package/__internal__/src/components/BookmarkTabsCanary/useBookmarkTabs.d.ts +1 -1
- package/__internal__/src/components/BookmarkTabsCanary/useBookmarkTabs.js.map +1 -1
- 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 +1 -0
- package/__internal__/src/components/CheckboxGroup/types.d.ts +13 -9
- package/__internal__/src/components/CheckboxGroup/types.js +1 -1
- package/__internal__/src/components/CheckboxGroup/types.js.map +1 -1
- package/__internal__/src/components/ChoiceGroup/types.d.ts +3 -3
- package/__internal__/src/components/ChoiceGroup/types.js.map +1 -1
- package/__internal__/src/components/ChoiceGroupDeprecated/ChoiceGroupDeprecated.d.ts +3 -3
- package/__internal__/src/components/ChoiceGroupDeprecated/ChoiceGroupDeprecated.js.map +1 -1
- package/__internal__/src/components/Combobox/Combobox.js +1 -1
- package/__internal__/src/components/Combobox/Combobox.js.map +1 -1
- package/__internal__/src/components/Combobox/helpers.d.ts +3 -1
- package/__internal__/src/components/Combobox/helpers.js +1 -1
- package/__internal__/src/components/Combobox/helpers.js.map +1 -1
- package/__internal__/src/components/ComboboxCanary/ComboboxCanary.js +1 -1
- package/__internal__/src/components/ComboboxCanary/ComboboxCanary.js.map +1 -1
- package/__internal__/src/components/ComboboxCanary/helpers.d.ts +3 -1
- package/__internal__/src/components/ComboboxCanary/helpers.js +1 -1
- package/__internal__/src/components/ComboboxCanary/helpers.js.map +1 -1
- package/__internal__/src/components/DateTime/helpers/getHandleSelectDate.d.ts +3 -3
- package/__internal__/src/components/DateTime/helpers/getHandleSelectDate.js.map +1 -1
- package/__internal__/src/components/DateTime/helpers/types.d.ts +4 -4
- package/__internal__/src/components/DateTime/helpers/types.js.map +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/Loader/Loader.css +1 -1
- package/__internal__/src/components/Loader/Loader.d.ts +1 -1
- package/__internal__/src/components/Loader/Loader.js +1 -1
- package/__internal__/src/components/Loader/Loader.js.map +1 -1
- package/__internal__/src/components/LoaderCanary/Loader.css +1 -1
- package/__internal__/src/components/LoaderCanary/LoaderCanary.d.ts +2 -2
- package/__internal__/src/components/LoaderCanary/types.d.ts +1 -1
- package/__internal__/src/components/LoaderCanary/types.js +1 -1
- package/__internal__/src/components/LoaderCanary/types.js.map +1 -1
- package/__internal__/src/components/PaginationCanary/Pagination.css +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationArrow/PaginationArrow.css +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationArrow/PaginationArrow.d.ts +11 -0
- package/__internal__/src/components/PaginationCanary/PaginationArrow/PaginationArrow.js +2 -0
- package/__internal__/src/components/PaginationCanary/PaginationArrow/PaginationArrow.js.map +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationArrow/index.d.ts +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationArrow/index.js +2 -0
- package/__internal__/src/components/PaginationCanary/PaginationArrow/index.js.map +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationBase/PaginationBase.css +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationBase/PaginationBase.d.ts +3 -0
- package/__internal__/src/components/PaginationCanary/PaginationBase/PaginationBase.js +2 -0
- package/__internal__/src/components/PaginationCanary/PaginationBase/PaginationBase.js.map +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationBase/index.d.ts +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationBase/index.js +2 -0
- package/__internal__/src/components/PaginationCanary/PaginationBase/index.js.map +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationCanary.d.ts +3 -0
- package/__internal__/src/components/PaginationCanary/PaginationCanary.js +2 -0
- package/__internal__/src/components/PaginationCanary/PaginationCanary.js.map +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationItem/PaginationItem.css +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationItem/PaginationItem.d.ts +3 -0
- package/__internal__/src/components/PaginationCanary/PaginationItem/PaginationItem.js +2 -0
- package/__internal__/src/components/PaginationCanary/PaginationItem/PaginationItem.js.map +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationItem/index.d.ts +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationItem/index.js +2 -0
- package/__internal__/src/components/PaginationCanary/PaginationItem/index.js.map +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationList/PaginationList.css +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationList/PaginationList.d.ts +3 -0
- package/__internal__/src/components/PaginationCanary/PaginationList/PaginationList.js +2 -0
- package/__internal__/src/components/PaginationCanary/PaginationList/PaginationList.js.map +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationList/index.d.ts +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationList/index.js +2 -0
- package/__internal__/src/components/PaginationCanary/PaginationList/index.js.map +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationNumberInput/PaginationNumberInput.css +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationNumberInput/PaginationNumberInput.d.ts +10 -0
- package/__internal__/src/components/PaginationCanary/PaginationNumberInput/PaginationNumberInput.js +2 -0
- package/__internal__/src/components/PaginationCanary/PaginationNumberInput/PaginationNumberInput.js.map +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationNumberInput/index.d.ts +1 -0
- package/__internal__/src/components/PaginationCanary/PaginationNumberInput/index.js +2 -0
- package/__internal__/src/components/PaginationCanary/PaginationNumberInput/index.js.map +1 -0
- package/__internal__/src/components/PaginationCanary/helpers.d.ts +560 -0
- package/__internal__/src/components/PaginationCanary/helpers.js +2 -0
- package/__internal__/src/components/PaginationCanary/helpers.js.map +1 -0
- package/__internal__/src/components/PaginationCanary/index.d.ts +2 -0
- package/__internal__/src/components/PaginationCanary/index.js +2 -0
- package/__internal__/src/components/PaginationCanary/index.js.map +1 -0
- package/__internal__/src/components/PaginationCanary/types.d.ts +148 -0
- package/__internal__/src/components/PaginationCanary/types.js +2 -0
- package/__internal__/src/components/PaginationCanary/types.js.map +1 -0
- package/__internal__/src/components/PaginationCanary/usePaginationItems.d.ts +19 -0
- package/__internal__/src/components/PaginationCanary/usePaginationItems.js +2 -0
- package/__internal__/src/components/PaginationCanary/usePaginationItems.js.map +1 -0
- package/__internal__/src/components/PaginationCanary/usePaginationKeys.d.ts +10 -0
- package/__internal__/src/components/PaginationCanary/usePaginationKeys.js +2 -0
- package/__internal__/src/components/PaginationCanary/usePaginationKeys.js.map +1 -0
- 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/Responses/Responses.css +1 -1
- package/__internal__/src/components/Responses/Responses.d.ts +1 -1
- package/__internal__/src/components/Responses/Responses.js +1 -1
- package/__internal__/src/components/Responses/Responses.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/Responses500/Responses500.d.ts +2 -2
- package/__internal__/src/components/Responses500/Responses500.js +1 -1
- package/__internal__/src/components/Responses500/Responses500.js.map +1 -1
- package/__internal__/src/components/Responses503/Responses503.d.ts +2 -2
- package/__internal__/src/components/Responses503/Responses503.js +1 -1
- package/__internal__/src/components/Responses503/Responses503.js.map +1 -1
- package/__internal__/src/components/ResponsesConnectionError/ResponsesConnectionError.js +1 -1
- package/__internal__/src/components/ResponsesConnectionError/ResponsesConnectionError.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/Select/Select.js +1 -1
- package/__internal__/src/components/Select/Select.js.map +1 -1
- package/__internal__/src/components/Select/helpers.d.ts +2 -1
- package/__internal__/src/components/Select/helpers.js +1 -1
- package/__internal__/src/components/Select/helpers.js.map +1 -1
- package/__internal__/src/components/SelectCanary/SelectCanary.js +1 -1
- package/__internal__/src/components/SelectCanary/SelectCanary.js.map +1 -1
- package/__internal__/src/components/SelectCanary/helpers.d.ts +2 -1
- package/__internal__/src/components/SelectCanary/helpers.js +1 -1
- package/__internal__/src/components/SelectCanary/helpers.js.map +1 -1
- package/__internal__/src/components/SelectComponents/Select.css +1 -1
- package/__internal__/src/components/SelectComponentsCanary/Select.css +1 -1
- package/__internal__/src/components/Slider/SliderPoint/SliderPoint.js +1 -1
- package/__internal__/src/components/Slider/SliderPoint/SliderPoint.js.map +1 -1
- package/__internal__/src/components/Table/filtering.js +1 -1
- package/__internal__/src/components/Table/filtering.js.map +1 -1
- package/__internal__/src/components/Table/helpers.js +1 -1
- package/__internal__/src/components/Table/helpers.js.map +1 -1
- package/__internal__/src/components/Tabs/Tabs.js +1 -1
- package/__internal__/src/components/Tabs/Tabs.js.map +1 -1
- package/__internal__/src/components/Tabs/{FitModeDropdownWrapper → TabsFitModeDropdownWrapper}/TabsFitModeDropdownWrapper.d.ts +1 -1
- package/__internal__/src/components/Tabs/TabsFitModeDropdownWrapper/TabsFitModeDropdownWrapper.js +2 -0
- package/__internal__/src/components/Tabs/TabsFitModeDropdownWrapper/TabsFitModeDropdownWrapper.js.map +1 -0
- package/__internal__/src/components/Tabs/TabsFitModeDropdownWrapper/useFittingItems.js.map +1 -0
- package/__internal__/src/components/Tabs/TabsFitModeScrollWrapper/TabsFitModeScrollWrapper.js +2 -0
- package/__internal__/src/components/Tabs/TabsFitModeScrollWrapper/TabsFitModeScrollWrapper.js.map +1 -0
- package/__internal__/src/components/Tabs/TabsFitModeScrollWrapper/__test__/helpers.test.js.map +1 -0
- package/__internal__/src/components/Tabs/TabsLine/TabsLine.js.map +1 -0
- package/__internal__/src/components/Tabs/TabsListWrapper/TabsListWrapper.d.ts +2 -0
- package/__internal__/src/components/Tabs/TabsListWrapper/TabsListWrapper.js +2 -0
- package/__internal__/src/components/Tabs/TabsListWrapper/TabsListWrapper.js.map +1 -0
- package/__internal__/src/components/Tabs/TabsListWrapper/index.d.ts +1 -0
- package/__internal__/src/components/Tabs/TabsListWrapper/index.js +2 -0
- package/__internal__/src/components/Tabs/TabsListWrapper/index.js.map +1 -0
- package/__internal__/src/components/Tabs/TabsMoreItems/TabsMoreItems.css +1 -0
- package/__internal__/src/components/Tabs/TabsMoreItems/TabsMoreItems.js +2 -0
- package/__internal__/src/components/Tabs/TabsMoreItems/TabsMoreItems.js.map +1 -0
- package/__internal__/src/components/Tabs/TabsTab/TabsTab.js.map +1 -0
- package/__internal__/src/components/Tabs/helpers.d.ts +329 -329
- package/__internal__/src/components/Tabs/helpers.js +1 -1
- package/__internal__/src/components/Tabs/helpers.js.map +1 -1
- package/__internal__/src/components/Tabs/index.d.ts +1 -1
- package/__internal__/src/components/Tabs/index.js +1 -1
- package/__internal__/src/components/Tabs/index.js.map +1 -1
- package/__internal__/src/components/Tabs/types.d.ts +3 -2
- package/__internal__/src/components/Tabs/types.js.map +1 -1
- package/__internal__/src/components/TabsDeprecated/FitModeScrollWrapper/helpers.js +1 -1
- package/__internal__/src/components/TabsDeprecated/FitModeScrollWrapper/helpers.js.map +1 -1
- package/__internal__/src/components/Theme/_color/Theme_color_gpnDark.css +1 -1
- package/__internal__/src/components/TooltipCanary/Tooltip.css +1 -0
- package/__internal__/src/components/TooltipCanary/TooltipCanary.d.ts +4 -0
- package/__internal__/src/components/TooltipCanary/TooltipCanary.js +2 -0
- package/__internal__/src/components/TooltipCanary/TooltipCanary.js.map +1 -0
- package/__internal__/src/components/TooltipCanary/index.d.ts +2 -0
- package/__internal__/src/components/TooltipCanary/index.js +2 -0
- package/__internal__/src/components/TooltipCanary/index.js.map +1 -0
- package/__internal__/src/components/TooltipCanary/types.d.ts +23 -0
- package/__internal__/src/components/TooltipCanary/types.js +2 -0
- package/__internal__/src/components/TooltipCanary/types.js.map +1 -0
- package/__internal__/src/components/UserSelect/UserSelect.js +1 -1
- package/__internal__/src/components/UserSelect/UserSelect.js.map +1 -1
- package/__internal__/src/components/UserSelect/helpers.d.ts +3 -1
- package/__internal__/src/components/UserSelect/helpers.js +1 -1
- package/__internal__/src/components/UserSelect/helpers.js.map +1 -1
- package/__internal__/src/components/UserSelectCanary/UserSelectCanary.js +1 -1
- package/__internal__/src/components/UserSelectCanary/UserSelectCanary.js.map +1 -1
- package/__internal__/src/components/UserSelectCanary/helpers.d.ts +3 -1
- package/__internal__/src/components/UserSelectCanary/helpers.js +1 -1
- package/__internal__/src/components/UserSelectCanary/helpers.js.map +1 -1
- package/__internal__/src/hocs/withTooltip/withTooltip.d.ts +1 -1
- package/__internal__/src/hocs/withTooltip/withTooltip.js +1 -1
- package/__internal__/src/hocs/withTooltip/withTooltip.js.map +1 -1
- package/package.json +1 -1
- package/__internal__/src/components/Tabs/FitModeDropdownWrapper/TabsFitModeDropdownWrapper.js +0 -2
- package/__internal__/src/components/Tabs/FitModeDropdownWrapper/TabsFitModeDropdownWrapper.js.map +0 -1
- package/__internal__/src/components/Tabs/FitModeDropdownWrapper/useFittingItems.js.map +0 -1
- package/__internal__/src/components/Tabs/FitModeScrollWrapper/TabsFitModeScrollWrapper.js +0 -2
- package/__internal__/src/components/Tabs/FitModeScrollWrapper/TabsFitModeScrollWrapper.js.map +0 -1
- package/__internal__/src/components/Tabs/FitModeScrollWrapper/__test__/helpers.test.js.map +0 -1
- package/__internal__/src/components/Tabs/Line/TabsLine.js.map +0 -1
- package/__internal__/src/components/Tabs/MoreItems/TabsMoreItems.css +0 -1
- package/__internal__/src/components/Tabs/MoreItems/TabsMoreItems.js +0 -2
- package/__internal__/src/components/Tabs/MoreItems/TabsMoreItems.js.map +0 -1
- package/__internal__/src/components/Tabs/Tab/TabsTab.js.map +0 -1
- /package/__internal__/src/components/Tabs/{FitModeDropdownWrapper → TabsFitModeDropdownWrapper}/TabsFitModeDropdownWrapper.css +0 -0
- /package/__internal__/src/components/Tabs/{FitModeDropdownWrapper → TabsFitModeDropdownWrapper}/useFittingItems.d.ts +0 -0
- /package/__internal__/src/components/Tabs/{FitModeDropdownWrapper → TabsFitModeDropdownWrapper}/useFittingItems.js +0 -0
- /package/__internal__/src/components/Tabs/{FitModeScrollWrapper → TabsFitModeScrollWrapper}/TabsFitModeScrollWrapper.css +0 -0
- /package/__internal__/src/components/Tabs/{FitModeScrollWrapper → TabsFitModeScrollWrapper}/TabsFitModeScrollWrapper.d.ts +0 -0
- /package/__internal__/src/components/Tabs/{FitModeScrollWrapper → TabsFitModeScrollWrapper}/__test__/helpers.test.d.ts +0 -0
- /package/__internal__/src/components/Tabs/{FitModeScrollWrapper → TabsFitModeScrollWrapper}/__test__/helpers.test.js +0 -0
- /package/__internal__/src/components/Tabs/{Line → TabsLine}/TabsLine.css +0 -0
- /package/__internal__/src/components/Tabs/{Line → TabsLine}/TabsLine.d.ts +0 -0
- /package/__internal__/src/components/Tabs/{Line → TabsLine}/TabsLine.js +0 -0
- /package/__internal__/src/components/Tabs/{MoreItems → TabsMoreItems}/TabsMoreItems.d.ts +0 -0
- /package/__internal__/src/components/Tabs/{Tab → TabsTab}/TabsTab.css +0 -0
- /package/__internal__/src/components/Tabs/{Tab → TabsTab}/TabsTab.d.ts +0 -0
- /package/__internal__/src/components/Tabs/{Tab → TabsTab}/TabsTab.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../__internal__/src/components/AttachmentCanary";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../__internal__/src/components/AttachmentCanary";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../__internal__/src/components/PaginationCanary";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../__internal__/src/components/PaginationCanary";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../__internal__/src/components/TooltipCanary";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../__internal__/src/components/TooltipCanary";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.canary--Attachment{background:var(--color-control-bg-clear);border-radius:var(--control-radius);box-sizing:border-box;display:flex;flex-direction:row;padding:var(--space-xs);text-decoration:none;transition:background-color .2s ease;width:100%}.canary--Attachment-File{flex:none;margin-right:var(--space-xs);transition:opacity .2s}.canary--Attachment-File_error{opacity:.4}.canary--Attachment-Button{flex:none;opacity:0;transition:opacity .2s ease}.canary--Attachment-Content{word-wrap:break-word;flex:1;overflow:hidden}.canary--Attachment-Content>.Text:not(:first-child){margin-top:var(--space-2xs)}.canary--Attachment-Content:not(:last-child){margin-right:var(--space-xs)}.canary--Attachment_withAction{cursor:pointer}.canary--Attachment_withAction:hover{background:var(--color-control-bg-clear-hover)}.canary--Attachment_withOnButtonAction:hover .canary--Attachment_withOnButtonAction-Button{opacity:1}.canary--Attachment_withOnButtonAction:hover{background:var(--color-control-bg-clear-hover)}.canary--Attachment_withOnButtonAction:hover .Attachment-Button{opacity:1}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import './Attachment.css';
|
|
2
|
+
import { AttachmentProps } from './types';
|
|
3
|
+
declare const cnAttachment: import("@bem-react/classname").ClassNameFormatter;
|
|
4
|
+
declare const Attachment: import("../../utils/types/PropsWithAsAttributes").ComponentWithAs<AttachmentProps, "div">;
|
|
5
|
+
export { Attachment, cnAttachment };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","as","fileExtension","withPictogram","loading","fileName","buttonIcon","onButtonClick","errorText","loadingText","loadingProgress","fileDescription","size","onClick","withAction","buttonTitle"];import"./Attachment.css";import React from"react";import{Button}from"../Button";import{File}from"../File";import{Text}from"../Text";import{cnCanary}from"../../utils/bem";import{forwardRefWithAs}from"../../utils/types/PropsWithAsAttributes";import{attachmentPropSizeDefault}from"./types";var cnAttachment=cnCanary("Attachment"),fileSizeMap={xs:"s",s:"s",m:"m"},textSizeMap={xs:"xs",s:"s",m:"s"},descriptionSizeMap={xs:"xs",s:"xs",m:"s"},Attachment=forwardRefWithAs(function(a,b){var c=a.className,d=a.as,e=void 0===d?"div":d,f=a.fileExtension,g=a.withPictogram,h=a.loading,i=a.fileName,j=a.buttonIcon,k=a.onButtonClick,l=a.errorText,m=a.loadingText,n=void 0===m?"Loading":m,o=a.loadingProgress,p=a.fileDescription,q=a.size,r=void 0===q?attachmentPropSizeDefault:q,s=a.onClick,t=a.withAction,u=a.buttonTitle,v=_objectWithoutProperties(a,_excluded),w=!!k;return React.createElement(e,Object.assign({},v,{onClick:s,className:cnAttachment({withAction:t||!!s,withOnButtonAction:w,size:r},[c]),ref:b}),g&&React.createElement(File,{className:cnAttachment("File",{error:!!l}),extension:f,loading:h,loadingWithProgressSpin:!0,loadingProgress:o,size:fileSizeMap[r]}),React.createElement("div",{className:cnAttachment("Content")},i&&React.createElement(Text,{className:cnAttachment("FileName"),size:textSizeMap[r],view:"primary",lineHeight:"xs"},i),p&&!h&&React.createElement(Text,{className:cnAttachment("FileDescription"),size:descriptionSizeMap[r],lineHeight:"xs",view:"ghost"},p),n&&h&&React.createElement(Text,{className:cnAttachment("LoadingText"),size:descriptionSizeMap[r],lineHeight:"xs",view:"ghost"},o?"".concat(n," ").concat(o,"%"):"".concat(n,"...")),l&&React.createElement(Text,{className:cnAttachment("ErrorText"),size:descriptionSizeMap[r],lineHeight:"xs",view:"alert"},l)),w&&React.createElement(Button,{className:cnAttachment("Button"),as:"span",onlyIcon:!0,iconLeft:j,onClick:k,title:u,size:"xs",view:"clear"}))});export{Attachment,cnAttachment};
|
|
2
|
+
//# sourceMappingURL=AttachmentCanary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachmentCanary.js","names":["React","Button","File","Text","cnCanary","forwardRefWithAs","attachmentPropSizeDefault","cnAttachment","fileSizeMap","xs","s","m","textSizeMap","descriptionSizeMap","Attachment","props","ref","className","as","fileExtension","withPictogram","loading","fileName","buttonIcon","onButtonClick","errorText","loadingText","loadingProgress","fileDescription","size","onClick","withActionProp","withAction","buttonTitle","otherProps","withOnButtonAction","error"],"sources":["../../../../../src/components/AttachmentCanary/AttachmentCanary.tsx"],"sourcesContent":["import './Attachment.css';\n\nimport React from 'react';\n\nimport { Button } from '##/components/Button';\nimport { File } from '##/components/File';\nimport { Text, TextPropSize } from '##/components/Text';\nimport { FileIconPropSize } from '##/fileIcons/FileIcon/FileIcon';\nimport { cnCanary } from '##/utils/bem';\nimport { forwardRefWithAs } from '##/utils/types/PropsWithAsAttributes';\n\nimport {\n AttachmentProps,\n AttachmentPropSize,\n attachmentPropSizeDefault,\n} from './types';\n\nconst cnAttachment = cnCanary('Attachment');\n\nconst fileSizeMap: Record<AttachmentPropSize, FileIconPropSize> = {\n xs: 's',\n s: 's',\n m: 'm',\n};\n\nconst textSizeMap: Record<AttachmentPropSize, TextPropSize> = {\n xs: 'xs',\n s: 's',\n m: 's',\n};\n\nconst descriptionSizeMap: Record<AttachmentPropSize, TextPropSize> = {\n xs: 'xs',\n s: 'xs',\n m: 's',\n};\n\nconst Attachment = forwardRefWithAs<AttachmentProps>((props, ref) => {\n const {\n className,\n as = 'div',\n fileExtension,\n withPictogram,\n loading,\n fileName,\n buttonIcon,\n onButtonClick,\n errorText,\n loadingText = 'Loading',\n loadingProgress,\n fileDescription,\n size = attachmentPropSizeDefault,\n onClick,\n withAction: withActionProp,\n buttonTitle,\n ...otherProps\n } = props;\n const Tag = as as string;\n const withAction = withActionProp || Boolean(onClick);\n const withOnButtonAction = Boolean(onButtonClick);\n\n return (\n <Tag\n {...otherProps}\n onClick={onClick}\n className={cnAttachment({ withAction, withOnButtonAction, size }, [\n className,\n ])}\n ref={ref}\n >\n {withPictogram && (\n <File\n className={cnAttachment('File', { error: Boolean(errorText) })}\n extension={fileExtension}\n loading={loading}\n loadingWithProgressSpin\n loadingProgress={loadingProgress}\n size={fileSizeMap[size]}\n />\n )}\n <div className={cnAttachment('Content')}>\n {fileName && (\n <Text\n className={cnAttachment('FileName')}\n size={textSizeMap[size]}\n view=\"primary\"\n lineHeight=\"xs\"\n >\n {fileName}\n </Text>\n )}\n {fileDescription && !loading && (\n <Text\n className={cnAttachment('FileDescription')}\n size={descriptionSizeMap[size]}\n lineHeight=\"xs\"\n view=\"ghost\"\n >\n {fileDescription}\n </Text>\n )}\n {loadingText && loading && (\n <Text\n className={cnAttachment('LoadingText')}\n size={descriptionSizeMap[size]}\n lineHeight=\"xs\"\n view=\"ghost\"\n >\n {loadingProgress\n ? `${loadingText} ${loadingProgress}%`\n : `${loadingText}...`}\n </Text>\n )}\n {errorText && (\n <Text\n className={cnAttachment('ErrorText')}\n size={descriptionSizeMap[size]}\n lineHeight=\"xs\"\n view=\"alert\"\n >\n {errorText}\n </Text>\n )}\n </div>\n {withOnButtonAction && (\n <Button\n className={cnAttachment('Button')}\n as=\"span\"\n onlyIcon\n iconLeft={buttonIcon}\n onClick={onButtonClick}\n title={buttonTitle}\n size=\"xs\"\n view=\"clear\"\n />\n )}\n </Tag>\n );\n});\n\nexport { Attachment, cnAttachment };\n"],"mappings":"kTAAA,yBAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,MAAT,iBACA,OAASC,IAAT,eACA,OAASC,IAAT,eAEA,OAASC,QAAT,uBACA,OAASC,gBAAT,+CAEA,OAGEC,yBAHF,e,GAMMC,aAAY,CAAGH,QAAQ,CAAC,YAAD,C,CAEvBI,WAAyD,CAAG,CAChEC,EAAE,CAAE,GAD4D,CAEhEC,CAAC,CAAE,GAF6D,CAGhEC,CAAC,CAAE,GAH6D,C,CAM5DC,WAAqD,CAAG,CAC5DH,EAAE,CAAE,IADwD,CAE5DC,CAAC,CAAE,GAFyD,CAG5DC,CAAC,CAAE,GAHyD,C,CAMxDE,kBAA4D,CAAG,CACnEJ,EAAE,CAAE,IAD+D,CAEnEC,CAAC,CAAE,IAFgE,CAGnEC,CAAC,CAAE,GAHgE,C,CAM/DG,UAAU,CAAGT,gBAAgB,CAAkB,SAACU,CAAD,CAAQC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V,CAIE,QAAQ,CAAEgB,CAJZ,CAKE,OAAO,CAAEC,CALX,CAME,KAAK,CAAES,CANT,CAOE,IAAI,CAAC,IAPP,CAQE,IAAI,CAAC,OARP,EA/DJ,CA4EH,CArGkC,C,CAuGnC,OAASnB,UAAT,CAAqBP,YAArB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AttachmentCanary';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/AttachmentCanary/index.ts"],"sourcesContent":["export * from './AttachmentCanary';\n"],"mappings":"AAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IconComponent } from '@consta/icons/Icon';
|
|
3
|
+
export declare const attachmentPropSize: readonly ["s", "xs", "m"];
|
|
4
|
+
export declare type AttachmentPropSize = typeof attachmentPropSize[number];
|
|
5
|
+
export declare const attachmentPropSizeDefault: AttachmentPropSize;
|
|
6
|
+
export declare type AttachmentProps = {
|
|
7
|
+
fileExtension?: string;
|
|
8
|
+
withPictogram?: boolean;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
fileName?: string;
|
|
11
|
+
fileDescription?: string;
|
|
12
|
+
loadingProgress?: number;
|
|
13
|
+
errorText?: string;
|
|
14
|
+
size?: AttachmentPropSize;
|
|
15
|
+
loadingText?: string;
|
|
16
|
+
onButtonClick?: React.EventHandler<React.MouseEvent>;
|
|
17
|
+
buttonIcon?: IconComponent;
|
|
18
|
+
buttonTitle?: string;
|
|
19
|
+
withAction?: boolean;
|
|
20
|
+
className?: string;
|
|
21
|
+
children?: never;
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":["attachmentPropSize","attachmentPropSizeDefault"],"sources":["../../../../../src/components/AttachmentCanary/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\n\nexport const attachmentPropSize = ['s', 'xs', 'm'] as const;\nexport type AttachmentPropSize = typeof attachmentPropSize[number];\nexport const attachmentPropSizeDefault: AttachmentPropSize =\n attachmentPropSize[0];\n\nexport type AttachmentProps = {\n fileExtension?: string;\n withPictogram?: boolean;\n loading?: boolean;\n fileName?: string;\n fileDescription?: string;\n loadingProgress?: number;\n errorText?: string;\n size?: AttachmentPropSize;\n loadingText?: string;\n onButtonClick?: React.EventHandler<React.MouseEvent>;\n buttonIcon?: IconComponent;\n buttonTitle?: string;\n withAction?: boolean;\n className?: string;\n children?: never;\n};\n"],"mappings":"AAEA,MAAO,IAAMA,mBAAkB,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAA3B,CAEP,MAAO,IAAMC,0BAA6C,CACxDD,kBAAkB,CAAC,CAAD,CADb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.BadgeGroup_size_l,.BadgeGroup_size_m{--badge-group-gap:var(--space-xs)}.BadgeGroup_size_s,.BadgeGroup_size_xs{--badge-group-gap:var(--space-2xs)}.BadgeGroup_fitMode_wrap{align-items:center;display:inline-flex;flex-wrap:wrap;gap:var(--badge-group-gap);justify-content:flex-start}.BadgeGroup_fitMode_reduction{display:inline-flex}.BadgeGroup_fitMode_reduction>:not(.BadgeGroup-Badge_zero){margin-right:var(--badge-group-gap)}.BadgeGroup_fitMode_reduction>:not(.BadgeGroup-Badge_zero):last-child{margin-right:0}.BadgeGroup-Badge.Badge{position:static}.BadgeGroup-Badge_hidden.Badge{left:-300vw;position:absolute;visibility:hidden}
|
|
1
|
+
.BadgeGroup_size_l,.BadgeGroup_size_m{--badge-group-gap:var(--space-xs)}.BadgeGroup_size_s,.BadgeGroup_size_xs{--badge-group-gap:var(--space-2xs)}.BadgeGroup_fitMode_wrap{align-items:center;display:inline-flex;flex-wrap:wrap;gap:var(--badge-group-gap);justify-content:flex-start}.BadgeGroup_fitMode_reduction{display:inline-flex}.BadgeGroup_fitMode_reduction>:not(.BadgeGroup-Badge_zero){margin-right:var(--badge-group-gap)}.BadgeGroup_fitMode_reduction>:not(.BadgeGroup-Badge_zero):last-child{margin-right:0}.BadgeGroup-Badge.Badge{position:static}.BadgeGroup-Badge_hidden.Badge{left:-300vw;position:absolute;visibility:hidden}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["items","fitMode","getItemAs","getItemAttributes","getItemIconLeft","getItemIconRight","getItemKey","getItemLabel","getItemStatus","getItemRef","getItemView","minified","size","form","className","moreRef","moreAttributes"];import"./BadgeGroup.css";import React,{forwardRef}from"react";import{forkRef,useForkRef}from"../../hooks/useForkRef";import{useHideElementsInLine}from"../../hooks/
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["items","fitMode","getItemAs","getItemAttributes","getItemIconLeft","getItemIconRight","getItemKey","getItemLabel","getItemStatus","getItemRef","getItemView","minified","size","form","className","moreRef","moreAttributes"];import"./BadgeGroup.css";import React,{forwardRef}from"react";import{forkRef,useForkRef}from"../../hooks/useForkRef";import{useHideElementsInLine}from"../../hooks/useHideElementsInLineCanary";import{cn}from"../../utils/bem";import{Badge,badgePropFormDefault,badgePropSizeDefault}from"../Badge/Badge";import{withDefaultGetters}from"./helper";var cnBadgeGroup=cn("BadgeGroup"),BadgeGroupRender=function(a,b){var c=withDefaultGetters(a),d=c.items,e=c.fitMode,f=void 0===e?"wrap":e,g=c.getItemAs,h=c.getItemAttributes,i=c.getItemIconLeft,j=c.getItemIconRight,k=c.getItemKey,l=c.getItemLabel,m=c.getItemStatus,n=c.getItemRef,o=c.getItemView,p=c.minified,q=c.size,r=void 0===q?badgePropSizeDefault:q,s=c.form,t=void 0===s?badgePropFormDefault:s,u=c.className,v=c.moreRef,w=c.moreAttributes,x=_objectWithoutProperties(c,_excluded),y=d.length+1,z=y-1,A=useHideElementsInLine(y,z,0,[f,t]),B=A.visibleMap,C=A.elementsRefs,D=A.parentRef,E=useForkRef([C[z],v]);return React.createElement("div",Object.assign({ref:useForkRef([b,D]),className:cnBadgeGroup({size:r,fitMode:f},[u])},x),d.map(function(a,b){var c=g(a);return React.createElement(Badge,Object.assign({key:k(a),size:r,form:t,minified:p,label:l(a),iconLeft:i(a),iconRight:j(a),as:c,ref:forkRef([C[b],n(a)]),view:o(a),status:m(a),className:cnBadgeGroup("Badge",{hidden:!("reduction"!==f)&&!B[b]})},h(a)))}),"reduction"===f&&React.createElement(Badge,Object.assign({className:cnBadgeGroup("Badge",{hidden:!B[d.length]}),key:"more",label:"+".concat(B.filter(function(a){return!a}).length),status:"system",form:t,size:r,view:"filled",ref:E},w)))};export var BadgeGroup=forwardRef(BadgeGroupRender);export*from"./types";
|
|
2
2
|
//# sourceMappingURL=BadgeGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeGroup.js","names":["React","forwardRef","forkRef","useForkRef","useHideElementsInLine","cn","Badge","badgePropFormDefault","badgePropSizeDefault","withDefaultGetters","cnBadgeGroup","BadgeGroupRender","props","ref","items","fitMode","getItemAs","getItemAttributes","getItemIconLeft","getItemIconRight","getItemKey","getItemLabel","getItemStatus","getItemRef","getItemView","minified","size","form","className","moreRefProp","moreRef","moreAttributes","otherProps","
|
|
1
|
+
{"version":3,"file":"BadgeGroup.js","names":["React","forwardRef","forkRef","useForkRef","useHideElementsInLine","cn","Badge","badgePropFormDefault","badgePropSizeDefault","withDefaultGetters","cnBadgeGroup","BadgeGroupRender","props","ref","items","fitMode","getItemAs","getItemAttributes","getItemIconLeft","getItemIconRight","getItemKey","getItemLabel","getItemStatus","getItemRef","getItemView","minified","size","form","className","moreRefProp","moreRef","moreAttributes","otherProps","length","moreIndex","visibleMap","elementsRefs","parentRef","map","item","index","as","hidden","filter","BadgeGroup"],"sources":["../../../../../src/components/BadgeGroup/BadgeGroup.tsx"],"sourcesContent":["import './BadgeGroup.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { forkRef, useForkRef } from '##/hooks/useForkRef';\nimport { useHideElementsInLine } from '##/hooks/useHideElementsInLineCanary';\nimport { cn } from '##/utils/bem';\n\nimport {\n Badge,\n badgePropFormDefault,\n badgePropSizeDefault,\n} from '../Badge/Badge';\nimport { withDefaultGetters } from './helper';\nimport { BadgeGroupComponent, BadgeGroupProps } from './types';\n\nconst cnBadgeGroup = cn('BadgeGroup');\n\nconst BadgeGroupRender = (\n props: BadgeGroupProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n items,\n fitMode = 'wrap',\n getItemAs,\n getItemAttributes,\n getItemIconLeft,\n getItemIconRight,\n getItemKey,\n getItemLabel,\n getItemStatus,\n getItemRef,\n getItemView,\n minified,\n size = badgePropSizeDefault,\n form = badgePropFormDefault,\n className,\n moreRef: moreRefProp,\n moreAttributes,\n ...otherProps\n } = withDefaultGetters(props);\n\n const length = items.length + 1;\n const moreIndex = length - 1;\n\n const { visibleMap, elementsRefs, parentRef } = useHideElementsInLine(\n length,\n moreIndex,\n 0,\n [fitMode, form],\n );\n\n const moreRef = useForkRef([elementsRefs[moreIndex], moreRefProp]);\n\n return (\n <div\n ref={useForkRef([ref, parentRef])}\n className={cnBadgeGroup({ size, fitMode }, [className])}\n {...otherProps}\n >\n {items.map((item, index) => {\n const as = getItemAs(item);\n return (\n <Badge\n key={getItemKey(item)}\n size={size}\n form={form}\n minified={minified}\n label={getItemLabel(item)}\n iconLeft={getItemIconLeft(item)}\n iconRight={getItemIconRight(item)}\n as={as}\n ref={forkRef([elementsRefs[index], getItemRef(item)])}\n view={getItemView(item)}\n status={getItemStatus(item)}\n className={cnBadgeGroup('Badge', {\n hidden: fitMode === 'reduction' ? !visibleMap[index] : false,\n })}\n {...getItemAttributes(item)}\n />\n );\n })}\n {fitMode === 'reduction' && (\n <Badge\n className={cnBadgeGroup('Badge', {\n hidden: !visibleMap[items.length],\n })}\n key=\"more\"\n label={`+${visibleMap.filter((item) => !item).length}`}\n status=\"system\"\n form={form}\n size={size}\n view=\"filled\"\n ref={moreRef}\n {...moreAttribut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AAS,CAAEL,YAAY,CAAC,OAAD,CAAU,CAC/BgC,MAAM,CAAE,CAACP,CAAU,CAACrB,CAAK,CAACmB,MAAP,CADY,CAAV,CADzB,CAIE,GAAG,CAAC,MAJN,CAKE,KAAK,YAAME,CAAU,CAACQ,MAAX,CAAkB,SAACJ,CAAD,QAAU,CAACA,CAAX,CAAlB,EAAmCN,MAAzC,CALP,CAME,MAAM,CAAC,QANT,CAOE,IAAI,CAAEN,CAPR,CAQE,IAAI,CAAED,CARR,CASE,IAAI,CAAC,QATP,CAUE,GAAG,CAAEI,CAVP,EAWMC,CAXN,EA5BJ,CA4CH,C,CAED,MAAO,IAAMa,WAAU,CAAG3C,UAAU,CAACU,gBAAD,CAA7B,CAEP"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["item","attributes","as"],_excluded2=["items","value","onCreate","getItemKey","getItemLabel","getItemLeftIcon","getItemRightIcon","getItemAs","getItemRef","getItemAttributes","getItemFixed","onChange","onRemove","renderItem","size","form","view","withNavigationButtons","className","id"];import"./BookmarkTabs.css";import{IconAdd}from"@consta/icons/IconAdd";import{IconArrowLeft}from"@consta/icons/IconArrowLeft";import{IconArrowRight}from"@consta/icons/IconArrowRight";import React,{forwardRef,useMemo}from"react";import{useComponentSize}from"../../hooks/useComponentSize";import{useForkRef}from"../../hooks/useForkRef";import{cnCanary as cn}from"../../utils/bem";import{Button}from"../Button";import{BookmarkTabsTab}from"./BookmarkTabsTab";import{withDefaultGetters}from"./helper";import{bookmarkTabsPropFormDefault,bookmarkTabsPropSizeDefault,bookmarkTabsPropViewDefault}from"./types";import{useBookmarkTabs}from"./useBookmarkTabs";export var cnBookmarkTabs=cn("BookmarkTabs");var renderItemDefault=function(a){var b=a.item,c=a.attributes,d=void 0===c?{}:c,e=a.as,f=_objectWithoutProperties(a,_excluded);return React.createElement(BookmarkTabsTab,Object.assign({},d,f,{as:e}))},BookmarkTabsRender=function(a,b){var c=withDefaultGetters(a),d=c.items,e=void 0===d?[]:d,f=c.value,g=c.onCreate,h=c.getItemKey,i=c.getItemLabel,j=c.getItemLeftIcon,k=c.getItemRightIcon,l=c.getItemAs,m=c.getItemRef,n=c.getItemAttributes,o=c.getItemFixed,p=c.onChange,q=c.onRemove,r=c.renderItem,s=void 0===r?renderItemDefault:r,t=c.size,u=void 0===t?bookmarkTabsPropSizeDefault:t,v=c.form,w=void 0===v?bookmarkTabsPropFormDefault:v,x=c.view,y=void 0===x?bookmarkTabsPropViewDefault:x,z=c.withNavigationButtons,A=c.
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["item","attributes","as"],_excluded2=["items","value","onCreate","getItemKey","getItemLabel","getItemLeftIcon","getItemRightIcon","getItemAs","getItemRef","getItemAttributes","getItemFixed","onChange","onRemove","renderItem","size","form","view","withNavigationButtons","onMouseLeave","className","id"];import"./BookmarkTabs.css";import{IconAdd}from"@consta/icons/IconAdd";import{IconArrowLeft}from"@consta/icons/IconArrowLeft";import{IconArrowRight}from"@consta/icons/IconArrowRight";import React,{forwardRef,useMemo,useState}from"react";import{useComponentSize}from"../../hooks/useComponentSize";import{useForkRef}from"../../hooks/useForkRef";import{cnCanary as cn}from"../../utils/bem";import{Button}from"../Button";import{BookmarkTabsTab}from"./BookmarkTabsTab";import{withDefaultGetters}from"./helper";import{bookmarkTabsPropFormDefault,bookmarkTabsPropSizeDefault,bookmarkTabsPropViewDefault}from"./types";import{useBookmarkTabs}from"./useBookmarkTabs";export var cnBookmarkTabs=cn("BookmarkTabs");var renderItemDefault=function(a){var b=a.item,c=a.attributes,d=void 0===c?{}:c,e=a.as,f=_objectWithoutProperties(a,_excluded);return React.createElement(BookmarkTabsTab,Object.assign({},d,f,{as:e}))},BookmarkTabsRender=function(a,b){var c=withDefaultGetters(a),d=c.items,e=void 0===d?[]:d,f=c.value,g=c.onCreate,h=c.getItemKey,i=c.getItemLabel,j=c.getItemLeftIcon,k=c.getItemRightIcon,l=c.getItemAs,m=c.getItemRef,n=c.getItemAttributes,o=c.getItemFixed,p=c.onChange,q=c.onRemove,r=c.renderItem,s=void 0===r?renderItemDefault:r,t=c.size,u=void 0===t?bookmarkTabsPropSizeDefault:t,v=c.form,w=void 0===v?bookmarkTabsPropFormDefault:v,x=c.view,y=void 0===x?bookmarkTabsPropViewDefault:x,z=c.withNavigationButtons,A=c.onMouseLeave,B=c.className,C=c.id,D=_objectWithoutProperties(c,_excluded2),E=useState(null),F=_slicedToArray(E,2),G=F[0],H=F[1],I=function(a){return!!f&&h(a)===h(f)},J=useBookmarkTabs({items:e,getItemFixed:o,size:u,withNavigationButtons:z,withAddButton:!!g}),K=J.refs,L=J.fixedTabs,M=J.fixedTabsRef,N=J.otherTabs,O=J.otherTabsRef,P=J.showControls,Q=J.wrapperRef,R=J.containerRef,S=J.controlsRef,T=J.addButtonRef,U=J.navigate,V=J.sizes,W=useComponentSize(M),X=W.width,Y=function(a,b,c,d,e,f){var g;return React.createElement("div",{className:cnBookmarkTabs("Tab"),onMouseEnter:function onMouseEnter(){return H(e)},onFocus:function onFocus(){return H(e)},ref:c},s({item:a,onClick:function onClick(b){return null===p||void 0===p?void 0:p(a,{e:b})},active:I(a),label:i(a),leftIcon:j(a),rightIcon:k(a),as:null!==(g=l(a))&&void 0!==g?g:"div",attributes:n(a),tabRef:m(a),fixed:b,bordered:d,onClose:q?function(b){return q(a,{e:b})}:void 0,size:u,view:y,hovered:G===e,form:w,tabWidth:f}))},Z=useMemo(function(){var a=[].concat(_toConsumableArray(L),_toConsumableArray(N)),b=f?a.indexOf(f):-1;return Array.from(Array(a.length-1).keys()).filter(function(a){return"round"!==w||a!==b&&a!==b-1})},[L,N,f,w]);return React.createElement("div",Object.assign({className:cnBookmarkTabs({size:u,view:y,form:w},[B]),ref:useForkRef([b,R]),id:C,onMouseLeave:function onMouseLeave(a){null===A||void 0===A?void 0:A(a),H(null)}},D),P&&React.createElement("div",{ref:S,className:cnBookmarkTabs("ScrollControls")},React.createElement("div",{className:cnBookmarkTabs("Button")},React.createElement(Button,{view:"clear",size:"xs",type:"button",onClick:function onClick(){return U("prev")},iconLeft:IconArrowLeft,onlyIcon:!0})),React.createElement("div",{className:cnBookmarkTabs("Button")},React.createElement(Button,{view:"clear",size:"xs",type:"button",onClick:function onClick(){return U("next")},iconLeft:IconArrowRight,onlyIcon:!0}))),React.createElement("div",{ref:Q,className:cnBookmarkTabs("Wrapper")},React.createElement("div",{style:_defineProperty({},"--bookmarks-list-width","max-content"),ref:M,className:cnBookmarkTabs("List")},L.map(function(a,b){return React.createElement(React.Fragment,{key:h(a)},Y(a,!0,K[b],Z.includes(b),b))})),React.createElement("div",{style:_defineProperty({},"--bookmarks-list-width","calc(100% - ".concat(X,"px)")),className:cnBookmarkTabs("List"),ref:O},N.map(function(a,b){var c=L.length;return React.createElement(React.Fragment,{key:h(a)},Y(a,!1,K[c+b],Z.includes(c+b),c+b,V[b]))}))),g&&React.createElement("div",{ref:T,className:cnBookmarkTabs("Button",{type:"add"})},React.createElement(Button,{view:"clear",size:"xs",type:"button",onClick:g,iconLeft:IconAdd,onlyIcon:!0})),React.createElement("div",{className:cnBookmarkTabs("Empty")}))};export var BookmarkTabs=forwardRef(BookmarkTabsRender);
|
|
2
2
|
//# sourceMappingURL=BookmarkTabsCanary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookmarkTabsCanary.js","names":["IconAdd","IconArrowLeft","IconArrowRight","React","forwardRef","useMemo","useComponentSize","useForkRef","cnCanary","cn","Button","BookmarkTabsTab","withDefaultGetters","bookmarkTabsPropFormDefault","bookmarkTabsPropSizeDefault","bookmarkTabsPropViewDefault","useBookmarkTabs","cnBookmarkTabs","renderItemDefault","props","_item","item","attributes","as","otherProps","BookmarkTabsRender","ref","items","value","onCreate","getItemKey","getItemLabel","getItemLeftIcon","getItemRightIcon","getItemAs","getItemRef","getItemAttributes","getItemFixed","onChange","onRemove","renderItem","renderItemProp","size","form","view","withNavigationButtons","className","id","getItemActive","withAddButton","refs","fixedTabs","fixedTabsRef","otherTabs","otherTabsRef","showControls","wrapperRef","containerRef","controlsRef","addButtonRef","navigate","sizes","fixedWidth","width","fixed","controlRef","bordered","tabWidth","onClick","e","active","label","leftIcon","rightIcon","tabRef","onClose","borderedIndexes","arr","activeIndex","indexOf","Array","from","length","keys","filter","el","map","index","includes","type","BookmarkTabs"],"sources":["../../../../../src/components/BookmarkTabsCanary/BookmarkTabsCanary.tsx"],"sourcesContent":["import './BookmarkTabs.css';\n\nimport { IconAdd } from '@consta/icons/IconAdd';\nimport { IconArrowLeft } from '@consta/icons/IconArrowLeft';\nimport { IconArrowRight } from '@consta/icons/IconArrowRight';\nimport React, { forwardRef, useMemo } from 'react';\n\nimport { useComponentSize } from '##/hooks/useComponentSize';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { cnCanary as cn } from '##/utils/bem';\n\nimport { Button } from '../Button';\nimport { BookmarkTabsTab } from './BookmarkTabsTab';\nimport { withDefaultGetters } from './helper';\nimport {\n BookmarkTabsComponent,\n bookmarkTabsPropFormDefault,\n BookmarkTabsProps,\n bookmarkTabsPropSizeDefault,\n bookmarkTabsPropViewDefault,\n BookmarkTabsRenderItemProps,\n} from './types';\nimport { useBookmarkTabs } from './useBookmarkTabs';\n\nexport const cnBookmarkTabs = cn('BookmarkTabs');\n\nconst renderItemDefault = <ITEM,>(\n props: BookmarkTabsRenderItemProps<ITEM>,\n): React.ReactElement => {\n const { item: _item, attributes = {}, as, ...otherProps } = props;\n return <BookmarkTabsTab {...attributes} {...otherProps} as={as} />;\n};\n\nconst BookmarkTabsRender = (\n props: BookmarkTabsProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n items = [],\n value,\n onCreate,\n getItemKey,\n getItemLabel,\n getItemLeftIcon,\n getItemRightIcon,\n getItemAs,\n getItemRef,\n getItemAttributes,\n getItemFixed,\n onChange,\n onRemove,\n renderItem: renderItemProp = renderItemDefault,\n size = bookmarkTabsPropSizeDefault,\n form = bookmarkTabsPropFormDefault,\n view = bookmarkTabsPropViewDefault,\n withNavigationButtons,\n className,\n id,\n ...otherProps\n } = withDefaultGetters(props);\n\n type Item = typeof items[number];\n\n const getItemActive = (item: Item) => {\n return value ? getItemKey(item) === getItemKey(value) : false;\n };\n\n const {\n refs,\n fixedTabs,\n fixedTabsRef,\n otherTabs,\n otherTabsRef,\n showControls,\n wrapperRef,\n containerRef,\n controlsRef,\n addButtonRef,\n navigate,\n sizes,\n } = useBookmarkTabs({\n items,\n getItemFixed,\n size,\n withNavigationButtons,\n withAddButton: !!onCreate,\n });\n\n const { width: fixedWidth } = useComponentSize(fixedTabsRef);\n\n const renderItem = (\n item: Item,\n fixed: boolean,\n controlRef: React.RefObject<HTMLElement>,\n bordered: boolean,\n tabWidth?: string,\n ) =>\n renderItemProp({\n item,\n onClick: (e) => onChange?.(item, { e }),\n active: getItemActive(item),\n label: getItemLabel(item),\n leftIcon: getItemLeftIcon(item),\n rightIcon: getItemRightIcon(item),\n as: getItemAs(item) ?? 'button',\n attributes: getItemAttributes(item),\n tabRef: getItemRef(item),\n controlRef,\n fixed,\n bordered,\n onClose: onRemove ? (e) => onRemove(item, { e }) : undefined,\n size,\n view,\n form,\n tabWidth,\n });\n\n const borderedIndexes = useMemo(() => {\n const arr = [...fixedTabs, ...otherTabs];\n const activeIndex = value ? arr.indexOf(value) : -1;\n return Array.from(Array(arr.length - 1).keys()).filter((el) =>\n form === 'round' ? el !== activeIndex && el !== activeIndex - 1 : true,\n );\n }, [fixedTabs, otherTabs, value, form]);\n\n return (\n <div\n className={cnBookmarkTabs({ size, view, form }, [className])}\n ref={useForkRef([ref, containerRef])}\n id={id}\n {...otherProps}\n >\n {showControls && (\n <div ref={controlsRef} className={cnBookmarkTabs('ScrollControls')}>\n <div className={cnBookmarkTabs('Button')}>\n <Button\n view=\"clear\"\n size=\"xs\"\n type=\"button\"\n onClick={() => navigate('prev')}\n iconLeft={IconArrowLeft}\n onlyIcon\n />\n </div>\n <div className={cnBookmarkTabs('Button')}>\n <Button\n view=\"clear\"\n size=\"xs\"\n type=\"button\"\n onClick={() => navigate('next')}\n iconLeft={IconArrowRight}\n onlyIcon\n />\n </div>\n </div>\n )}\n <div ref={wrapperRef} className={cnBookmarkTabs('Wrapper')}>\n <div\n style={{\n ['--bookmarks-list-width' as string]: `max-content`,\n }}\n ref={fixedTabsRef}\n className={cnBookmarkTabs('List')}\n >\n {fixedTabs.map((item, index) => (\n <React.Fragment key={getItemKey(item)}>\n {renderItem(\n item,\n true,\n refs[index],\n borderedIndexes.includes(index),\n )}\n </React.Fragment>\n ))}\n </div>\n <div\n style={{\n ['--bookmarks-list-width' as string]: `calc(100% - ${fixedWidth}px)`,\n }}\n className={cnBookmarkTabs('List')}\n ref={otherTabsRef}\n >\n {otherTabs.map((item, index) => (\n <React.Fragment key={getItemKey(item)}>\n {renderItem(\n item,\n false,\n refs[fixedTabs.length + index],\n borderedIndexes.includes(fixedTabs.length + index),\n sizes[index],\n )}\n </React.Fragment>\n ))}\n </div>\n </div>\n {onCreate && (\n <div\n ref={addButtonRef}\n className={cnBookmarkTabs('Button', { type: 'add' })}\n >\n <Button\n view=\"clear\"\n size=\"xs\"\n type=\"button\"\n onClick={onCreate}\n iconLeft={IconAdd}\n onlyIcon\n />\n </div>\n )}\n <div className={cnBookmarkTabs('Empty')} />\n </div>\n );\n};\n\nexport const BookmarkTabs = forwardRef(\n BookmarkTabsRender,\n) as BookmarkTabsComponent;\n"],"mappings":"ghBAAA,2BAEA,OAASA,OAAT,KAAwB,uBAAxB,CACA,OAASC,aAAT,KAA8B,6BAA9B,CACA,OAASC,cAAT,KAA+B,8BAA/B,CACA,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AACY,QAAhB,CAAyBD,CAAzB,CAJS,CADb,CADa,CAAd,CAPH,CADF,CAmBE,2BACE,KAAK,oBACF,wBADE,uBACkDzB,CADlD,QADP,CAIE,SAAS,CAAE7C,cAAc,CAAC,MAAD,CAJ3B,CAKE,GAAG,CAAEqC,CALP,EAOGD,CAAS,CAACiC,GAAV,CAAc,SAACjE,CAAD,CAAOkE,CAAP,QACb,qBAAC,KAAD,CAAO,QAAP,EAAgB,GAAG,CAAEzD,CAAU,CAACT,CAAD,CAA/B,EACGmB,CAAU,CACTnB,CADS,IAGT6B,CAAI,CAACC,CAAS,CAAC+B,MAAV,CAAmBK,CAApB,CAHK,CAITX,CAAe,CAACY,QAAhB,CAAyBrC,CAAS,CAAC+B,MAAV,CAAmBK,CAA5C,CAJS,CAKT1B,CAAK,CAAC0B,CAAD,CALI,CADb,CADa,CAAd,CAPH,CAnBF,CA9BF,CAqEG1D,CAAQ,EACP,2BACE,GAAG,CAAE8B,CADP,CAEE,SAAS,CAAE1C,cAAc,CAAC,QAAD,CAAW,CAAEwE,IAAI,CAAE,KAAR,CAAX,CAF3B,EAIE,oBAAC,MAAD,EACE,IAAI,CAAC,OADP,CAEE,IAAI,CAAC,IAFP,CAGE,IAAI,CAAC,QAHP,CAIE,OAAO,CAAE5D,CAJX,CAKE,QAAQ,CAAE7B,OALZ,CAME,QAAQ,GANV,EAJF,CAtEJ,CAoFE,2BAAK,SAAS,CAAEiB,cAAc,CAAC,OAAD,CAA9B,EApFF,CAuFH,C,CAED,MAAO,IAAMyE,aAAY,CAAGtF,UAAU,CACpCqB,kBADoC,CAA/B"}
|
|
1
|
+
{"version":3,"file":"BookmarkTabsCanary.js","names":["IconAdd","IconArrowLeft","IconArrowRight","React","forwardRef","useMemo","useState","useComponentSize","useForkRef","cnCanary","cn","Button","BookmarkTabsTab","withDefaultGetters","bookmarkTabsPropFormDefault","bookmarkTabsPropSizeDefault","bookmarkTabsPropViewDefault","useBookmarkTabs","cnBookmarkTabs","renderItemDefault","props","_item","item","attributes","as","otherProps","BookmarkTabsRender","ref","items","value","onCreate","getItemKey","getItemLabel","getItemLeftIcon","getItemRightIcon","getItemAs","getItemRef","getItemAttributes","getItemFixed","onChange","onRemove","renderItem","renderItemProp","size","form","view","withNavigationButtons","onMouseLeaveProp","onMouseLeave","className","id","higlightedIndex","setHighlitedIndex","getItemActive","withAddButton","refs","fixedTabs","fixedTabsRef","otherTabs","otherTabsRef","showControls","wrapperRef","containerRef","controlsRef","addButtonRef","navigate","sizes","fixedWidth","width","fixed","controlRef","bordered","index","tabWidth","onClick","e","active","label","leftIcon","rightIcon","tabRef","onClose","hovered","borderedIndexes","arr","activeIndex","indexOf","Array","from","length","keys","filter","el","map","includes","type","BookmarkTabs"],"sources":["../../../../../src/components/BookmarkTabsCanary/BookmarkTabsCanary.tsx"],"sourcesContent":["import './BookmarkTabs.css';\n\nimport { IconAdd } from '@consta/icons/IconAdd';\nimport { IconArrowLeft } from '@consta/icons/IconArrowLeft';\nimport { IconArrowRight } from '@consta/icons/IconArrowRight';\nimport React, { forwardRef, useMemo, useState } from 'react';\n\nimport { useComponentSize } from '##/hooks/useComponentSize';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { cnCanary as cn } from '##/utils/bem';\n\nimport { Button } from '../Button';\nimport { BookmarkTabsTab } from './BookmarkTabsTab';\nimport { withDefaultGetters } from './helper';\nimport {\n BookmarkTabsComponent,\n bookmarkTabsPropFormDefault,\n BookmarkTabsProps,\n bookmarkTabsPropSizeDefault,\n bookmarkTabsPropViewDefault,\n BookmarkTabsRenderItemProps,\n} from './types';\nimport { useBookmarkTabs } from './useBookmarkTabs';\n\nexport const cnBookmarkTabs = cn('BookmarkTabs');\n\nconst renderItemDefault = <ITEM,>(\n props: BookmarkTabsRenderItemProps<ITEM>,\n): React.ReactElement => {\n const { item: _item, attributes = {}, as, ...otherProps } = props;\n return <BookmarkTabsTab {...attributes} {...otherProps} as={as} />;\n};\n\nconst BookmarkTabsRender = (\n props: BookmarkTabsProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n items = [],\n value,\n onCreate,\n getItemKey,\n getItemLabel,\n getItemLeftIcon,\n getItemRightIcon,\n getItemAs,\n getItemRef,\n getItemAttributes,\n getItemFixed,\n onChange,\n onRemove,\n renderItem: renderItemProp = renderItemDefault,\n size = bookmarkTabsPropSizeDefault,\n form = bookmarkTabsPropFormDefault,\n view = bookmarkTabsPropViewDefault,\n withNavigationButtons,\n onMouseLeave: onMouseLeaveProp,\n className,\n id,\n ...otherProps\n } = withDefaultGetters(props);\n\n const [higlightedIndex, setHighlitedIndex] = useState<number | null>(null);\n\n type Item = typeof items[number];\n\n const getItemActive = (item: Item) => {\n return value ? getItemKey(item) === getItemKey(value) : false;\n };\n\n const {\n refs,\n fixedTabs,\n fixedTabsRef,\n otherTabs,\n otherTabsRef,\n showControls,\n wrapperRef,\n containerRef,\n controlsRef,\n addButtonRef,\n navigate,\n sizes,\n } = useBookmarkTabs({\n items,\n getItemFixed,\n size,\n withNavigationButtons,\n withAddButton: !!onCreate,\n });\n\n const { width: fixedWidth } = useComponentSize(fixedTabsRef);\n\n const renderItem = (\n item: Item,\n fixed: boolean,\n controlRef: React.RefObject<HTMLDivElement>,\n bordered: boolean,\n index: number,\n tabWidth?: string,\n ) => (\n <div\n className={cnBookmarkTabs('Tab')}\n onMouseEnter={() => setHighlitedIndex(index)}\n onFocus={() => setHighlitedIndex(index)}\n ref={controlRef}\n >\n {renderItemProp({\n item,\n onClick: (e) => onChange?.(item, { e }),\n active: getItemActive(item),\n label: getItemLabel(item),\n leftIcon: getItemLeftIcon(item),\n rightIcon: getItemRightIcon(item),\n as: getItemAs(item) ?? 'div',\n attributes: getItemAttributes(item),\n tabRef: getItemRef(item),\n fixed,\n bordered,\n onClose: onRemove ? (e) => onRemove(item, { e }) : undefined,\n size,\n view,\n hovered: higlightedIndex === index,\n form,\n tabWidth,\n })}\n </div>\n );\n\n const onMouseLeave: React.MouseEventHandler<HTMLDivElement> = (e) => {\n onMouseLeaveProp?.(e);\n setHighlitedIndex(null);\n };\n\n const borderedIndexes = useMemo(() => {\n const arr = [...fixedTabs, ...otherTabs];\n const activeIndex = value ? arr.indexOf(value) : -1;\n return Array.from(Array(arr.length - 1).keys()).filter((el) =>\n form === 'round' ? el !== activeIndex && el !== activeIndex - 1 : true,\n );\n }, [fixedTabs, otherTabs, value, form]);\n\n return (\n <div\n className={cnBookmarkTabs({ size, view, form }, [className])}\n ref={useForkRef([ref, containerRef])}\n id={id}\n onMouseLeave={onMouseLeave}\n {...otherProps}\n >\n {showControls && (\n <div ref={controlsRef} className={cnBookmarkTabs('ScrollControls')}>\n <div className={cnBookmarkTabs('Button')}>\n <Button\n view=\"clear\"\n size=\"xs\"\n type=\"button\"\n onClick={() => navigate('prev')}\n iconLeft={IconArrowLeft}\n onlyIcon\n />\n </div>\n <div className={cnBookmarkTabs('Button')}>\n <Button\n view=\"clear\"\n size=\"xs\"\n type=\"button\"\n onClick={() => navigate('next')}\n iconLeft={IconArrowRight}\n onlyIcon\n />\n </div>\n </div>\n )}\n <div ref={wrapperRef} className={cnBookmarkTabs('Wrapper')}>\n <div\n style={{\n ['--bookmarks-list-width' as string]: `max-content`,\n }}\n ref={fixedTabsRef}\n className={cnBookmarkTabs('List')}\n >\n {fixedTabs.map((item, index) => (\n <React.Fragment key={getItemKey(item)}>\n {renderItem(\n item,\n true,\n refs[index],\n borderedIndexes.includes(index),\n index,\n )}\n </React.Fragment>\n ))}\n </div>\n <div\n style={{\n ['--bookmarks-list-width' as string]: `calc(100% - ${fixedWidth}px)`,\n }}\n className={cnBookmarkTabs('List')}\n ref={otherTabsRef}\n >\n {otherTabs.map((item, index) => {\n const { length } = fixedTabs;\n return (\n <React.Fragment key={getItemKey(item)}>\n {renderItem(\n item,\n false,\n refs[length + index],\n borderedIndexes.includes(length + index),\n length + index,\n sizes[index],\n )}\n </React.Fragment>\n );\n })}\n </div>\n </div>\n {onCreate && (\n <div\n ref={addButtonRef}\n className={cnBookmarkTabs('Button', { type: 'add' })}\n >\n <Button\n view=\"clear\"\n size=\"xs\"\n type=\"button\"\n onClick={onCreate}\n iconLeft={IconAdd}\n onlyIcon\n />\n </div>\n )}\n <div className={cnBookmarkTabs('Empty')} />\n </div>\n );\n};\n\nexport const BookmarkTabs = forwardRef(\n BookmarkTabsRender,\n) as BookmarkTabsComponent;\n"],"mappings":"gmBAAA,2BAEA,OAASA,OAAT,KAAwB,uBAAxB,CACA,OAASC,aAAT,KAA8B,6BAA9B,CACA,OAASC,cAAT,KAA+B,8BAA/B,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,OAA5B,CAAqCC,QAArC,KAAqD,OAArD,CAEA,OAASC,gBAAT,oCACA,OAASC,UAAT,8BACA,OAASC,QAAQ,GAAIC,GAArB,uBAEA,OAASC,MAAT,iBACA,OAASC,eAAT,yBACA,OAASC,kBAAT,gBACA,OAEEC,2BAFF,CAIEC,2BAJF,CAKEC,2BALF,eAQA,OAASC,eAAT,yBAEA,MAAO,IAAMC,eAAc,CAAGR,EAAE,CAAC,cAAD,CAAzB,C,GAEDS,kBAAiB,CAAG,SACxBC,CADwB,CAED,CACvB,GAAcC,EAAd,CAA4DD,CAA5D,CAAQE,IAAR,GAA4DF,CAA5D,CAAqBG,UAArB,CAAqBA,CAArB,YAAkC,EAAlC,GAAsCC,CAAtC,CAA4DJ,CAA5D,CAAsCI,EAAtC,CAA6CC,CAA7C,0BAA4DL,CAA5D,YACA,MAAO,qBAAC,eAAD,kBAAqBG,CAArB,CAAqCE,CAArC,EAAiD,EAAE,CAAED,CAArD,GACR,C,CAEKE,kBAAkB,CAAG,SACzBN,CADyB,CAEzBO,CAFyB,CAGtB,OAwBCd,kBAAkB,CAACO,CAAD,CAxBnB,KAEDQ,KAFC,CAEDA,CAFC,YAEO,EAFP,GAGDC,CAHC,GAGDA,KAHC,CAIDC,CAJC,GAIDA,QAJC,CAKDC,CALC,GAKDA,UALC,CAMDC,CANC,GAMDA,YANC,CAODC,C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GAAG,CAAE1D,CAAU,CAACT,CAAD,CAA/B,EACGmB,CAAU,CACTnB,CADS,IAGTiC,CAAI,CAACkC,CAAM,CAAGjB,CAAV,CAHK,CAITW,CAAe,CAACW,QAAhB,CAAyBL,CAAM,CAAGjB,CAAlC,CAJS,CAKTiB,CAAM,CAAGjB,CALA,CAMTN,CAAK,CAACM,CAAD,CANI,CADb,CAWH,CAdA,CAPH,CApBF,CA/BF,CA2EG1C,CAAQ,EACP,2BACE,GAAG,CAAEkC,CADP,CAEE,SAAS,CAAE9C,cAAc,CAAC,QAAD,CAAW,CAAE6E,IAAI,CAAE,KAAR,CAAX,CAF3B,EAIE,oBAAC,MAAD,EACE,IAAI,CAAC,OADP,CAEE,IAAI,CAAC,IAFP,CAGE,IAAI,CAAC,QAHP,CAIE,OAAO,CAAEjE,CAJX,CAKE,QAAQ,CAAE9B,OALZ,CAME,QAAQ,GANV,EAJF,CA5EJ,CA0FE,2BAAK,SAAS,CAAEkB,cAAc,CAAC,OAAD,CAA9B,EA1FF,CA6FH,C,CAED,MAAO,IAAM8E,aAAY,CAAG5F,UAAU,CACpCsB,kBADoC,CAA/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.canary--BookmarkTabsTab{--bookmark-tabs-tab-close-size:0px;--bookmark-tabs-tab-right-icon-size:0px;align-items:center;background:none;border:none;box-sizing:border-box;cursor:pointer;display:inline-flex;height:var(--bookmark-tabs-tab-size);max-height:100%;max-width:200px;min-width:calc(var(--bookmark-tabs-tab-close-size) + var(--bookmark-tabs-tab-right-icon-size) + var(--bookmark-tabs-tab-left-icon-size) + var(--space-3xl) + var(--space-m));overflow:hidden;padding:var(--bookmark-tabs-tab-padding-top) var(--space-xs);position:relative;transition:background-color .3s,box-shadow .3s;width:var(--bookmarks-tab-width)}.canary--BookmarkTabsTab:
|
|
1
|
+
.canary--BookmarkTabsTab{--bookmark-tabs-tab-close-size:0px;--bookmark-tabs-tab-right-icon-size:0px;align-items:center;background:none;border:none;box-sizing:border-box;cursor:pointer;display:inline-flex;height:var(--bookmark-tabs-tab-size);max-height:100%;max-width:200px;min-width:calc(var(--bookmark-tabs-tab-close-size) + var(--bookmark-tabs-tab-right-icon-size) + var(--bookmark-tabs-tab-left-icon-size) + var(--space-3xl) + var(--space-m));overflow:hidden;padding:var(--bookmark-tabs-tab-padding-top) var(--space-xs);position:relative;transition:background-color .3s,box-shadow .3s;width:var(--bookmarks-tab-width)}.canary--BookmarkTabsTab:not(.canary--BookmarkTabsTab_active){border-bottom:1px solid var(--color-bg-border)}.canary--BookmarkTabsTab:not(.canary--BookmarkTabsTab_withLeftIcon){--bookmark-tabs-tab-left-icon-size:0px}.canary--BookmarkTabsTab_withCloseButton{--bookmark-tabs-tab-close-size:var(--space-2xl)}.canary--BookmarkTabsTab_withRightIcon{--bookmark-tabs-tab-right-icon-size:var(--space-l)}.canary--BookmarkTabsTab_view_ghost{--bookmark-tabs-tab-color:var(--color-typo-primary);background:var(--color-bg-secondary)}.canary--BookmarkTabsTab_view_clear{--bookmark-tabs-tab-color:var(--color-typo-secondary)}.canary--BookmarkTabsTab_size_s{--bookmark-tabs-tab-size:var(--space-2xl);--bookmark-tabs-tab-padding-top:var(--space-2xs);--bookmark-tabs-tab-left-icon-size:var(--space-l)}.canary--BookmarkTabsTab_size_m{--bookmark-tabs-tab-size:var(--space-3xl);--bookmark-tabs-tab-padding-top:var(--space-xs);--bookmark-tabs-tab-left-icon-size:var(--space-2xl)}.canary--BookmarkTabsTab_bordered:after{background:var(--color-bg-border);content:"";height:var(--bookmark-divider-height);position:absolute;right:0;top:var(--bookmark-divider-top);width:1px}.canary--BookmarkTabsTab_form_round{--bookmark-divider-top:calc(var(--space-l)/2);--bookmark-divider-height:calc(100% - var(--space-l));border-radius:var(--space-xs) var(--space-xs) 0 0}.canary--BookmarkTabsTab_form_round.canary--BookmarkTabsTab_active{border-left:1px solid var(--color-bg-border);border-right:1px solid var(--color-bg-border);border-top:1px solid var(--color-bg-border);padding-top:calc(var(--bookmark-tabs-tab-padding-top) - 1px)}.canary--BookmarkTabsTab_form_brick{--bookmark-divider-height:100%;--bookmark-divider-top:0}.canary--BookmarkTabsTab_fixed{--bookmark-tabs-tab-padding-top:var(--space-xs);min-width:var(--bookmark-tabs-tab-size);width:var(--bookmark-tabs-tab-size)}.canary--BookmarkTabsTab_hovered[class*=view]{--bookmark-tabs-tab-color:var(--color-control-typo-ghost-hover);background-color:var(--color-control-bg-ghost-hover)}.canary--BookmarkTabsTab_active{--bookmark-tabs-tab-color:var(--color-typo-primary);background:var(--color-bg-default)}.canary--BookmarkTabsTab-Icon_side_left,.canary--BookmarkTabsTab-Label.Text{color:var(--bookmark-tabs-tab-color);transition:color .3s}.canary--BookmarkTabsTab-Icon{display:block;min-width:var(--icon-size)}.canary--BookmarkTabsTab-Label{flex:auto;min-width:var(--space-3xl);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["label","leftIcon","rightIcon","as","onClick","size","form","active","fixed","tabRef","
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["label","leftIcon","rightIcon","as","onClick","size","form","active","fixed","tabRef","hovered","onClose","onKeyDown","view","className","bordered","tabWidth","style"];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"./BookmarkTabsTab.css";import{IconClose}from"@consta/icons/IconClose";import React,{forwardRef,useRef}from"react";import{Button}from"../../Button";import{Text}from"../../Text";import{useForkRef}from"../../../hooks/useForkRef";import{cnMixSpace}from"../../../mixs/MixSpace";import{cnCanary as cn}from"../../../utils/bem";export var cnBookmarkTabsTab=cn("BookmarkTabsTab");var BookmarkTabsTabRender=function(a,b){var c=a.label,d=a.leftIcon,e=a.rightIcon,f=a.as,g=void 0===f?"div":f,h=a.onClick,i=a.size,j=a.form,k=a.active,l=a.fixed,m=a.tabRef,n=a.hovered,o=a.onClose,p=a.onKeyDown,q=a.view,r=a.className,s=a.bordered,t=a.tabWidth,u=void 0===t?"100%":t,v=a.style,w=_objectWithoutProperties(a,_excluded),x=useRef(null),y=useRef(null);return React.createElement(g,Object.assign({className:cnBookmarkTabsTab({size:i,form:j,view:q,active:k,hovered:n,fixed:l,bordered:s,withCloseButton:!!o,withLeftIcon:!!d,withRightIcon:!!e},[r]),role:"button",onClick:h,onKeyDown:function onKeyDown(a){var b=a.code;if(null===p||void 0===p?void 0:p(a),o&&"Enter"===b){var c;a.stopPropagation(),a.preventDefault(),null===(c=x.current)||void 0===c?void 0:c.focus()}},ref:useForkRef([b,m,y]),style:_objectSpread(_defineProperty({},"--bookmarks-tab-width",u),v)},w),d&&React.createElement(d,{className:cnBookmarkTabsTab("Icon",{side:"left"},[l?void 0:cnMixSpace({mR:"s"===i?"2xs":"xs"})]),size:i}),!l&&React.createElement(React.Fragment,null,React.createElement(Text,{align:"left",className:cnBookmarkTabsTab("Label"),size:i},c),e&&React.createElement(e,{className:cnBookmarkTabsTab("Icon",{side:"right"},[cnMixSpace({mL:"xs"})]),size:"xs",view:"secondary"}),o&&React.createElement(Button,{size:"xs",onlyIcon:!0,ref:x,type:"button",view:"clear",onKeyDown:function onCloseKeydown(a){var b=a.code;if(a.stopPropagation(),a.preventDefault(),"Tab"===b||"Escape"===b){var c;null===y||void 0===y||null===(c=y.current)||void 0===c?void 0:c.focus()}("Enter"===b||"Space"===b)&&(null===o||void 0===o?void 0:o(a))},tabIndex:-1,className:cnBookmarkTabsTab("Button",[cnMixSpace({mL:"xs"})]),onClick:o,iconLeft:IconClose})))};export var BookmarkTabsTab=forwardRef(BookmarkTabsTabRender);
|
|
2
2
|
//# sourceMappingURL=BookmarkTabsTab.js.map
|
package/__internal__/src/components/BookmarkTabsCanary/BookmarkTabsTab/BookmarkTabsTab.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookmarkTabsTab.js","names":["IconClose","React","forwardRef","useRef","Button","Text","useForkRef","cnMixSpace","cnCanary","cn","cnBookmarkTabsTab","BookmarkTabsTabRender","props","ref","label","LeftIcon","leftIcon","RightIcon","rightIcon","as","Tag","onClick","size","form","active","fixed","tabRef","
|
|
1
|
+
{"version":3,"file":"BookmarkTabsTab.js","names":["IconClose","React","forwardRef","useRef","Button","Text","useForkRef","cnMixSpace","cnCanary","cn","cnBookmarkTabsTab","BookmarkTabsTabRender","props","ref","label","LeftIcon","leftIcon","RightIcon","rightIcon","as","Tag","onClick","size","form","active","fixed","tabRef","hovered","onClose","onKeyDownProp","onKeyDown","view","className","bordered","tabWidth","style","otherProps","closeButtonRef","tagRef","withCloseButton","withLeftIcon","withRightIcon","e","code","stopPropagation","preventDefault","current","focus","side","mR","mL","onCloseKeydown","BookmarkTabsTab"],"sources":["../../../../../../src/components/BookmarkTabsCanary/BookmarkTabsTab/BookmarkTabsTab.tsx"],"sourcesContent":["import './BookmarkTabsTab.css';\n\nimport { IconClose } from '@consta/icons/IconClose';\nimport React, { forwardRef, useRef } from 'react';\n\nimport { Button } from '##/components/Button';\nimport { Text } from '##/components/Text';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cnCanary as cn } from '##/utils/bem';\n\nimport { BookmarkTabsTabComponent, BookmarkTabsTabProps } from '../types';\n\nexport const cnBookmarkTabsTab = cn('BookmarkTabsTab');\n\nconst BookmarkTabsTabRender = (\n props: BookmarkTabsTabProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n label,\n leftIcon: LeftIcon,\n rightIcon: RightIcon,\n as: Tag = 'div',\n onClick,\n size,\n form,\n active,\n fixed,\n tabRef,\n hovered,\n onClose,\n onKeyDown: onKeyDownProp,\n view,\n className,\n bordered,\n tabWidth = '100%',\n style,\n ...otherProps\n } = props;\n\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n const tagRef = useRef<HTMLDivElement>(null);\n\n const onCloseKeydown: React.KeyboardEventHandler = (e) => {\n const { code } = e;\n e.stopPropagation();\n e.preventDefault();\n if (code === 'Tab' || code === 'Escape') {\n tagRef?.current?.focus();\n }\n if (code === 'Enter' || code === 'Space') {\n onClose?.(e);\n }\n };\n\n const onKeyDown: React.KeyboardEventHandler<HTMLDivElement> = (e) => {\n const { code } = e;\n onKeyDownProp?.(e);\n if (onClose && code === 'Enter') {\n e.stopPropagation();\n e.preventDefault();\n closeButtonRef.current?.focus();\n }\n };\n\n return (\n <Tag\n className={cnBookmarkTabsTab(\n {\n size,\n form,\n view,\n active,\n hovered,\n fixed,\n bordered,\n withCloseButton: !!onClose,\n withLeftIcon: !!LeftIcon,\n withRightIcon: !!RightIcon,\n },\n [className],\n )}\n role=\"button\"\n onClick={onClick}\n onKeyDown={onKeyDown}\n ref={useForkRef([ref, tabRef, tagRef])}\n style={{\n ['--bookmarks-tab-width' as string]: tabWidth,\n ...style,\n }}\n {...otherProps}\n >\n {LeftIcon && (\n <LeftIcon\n className={cnBookmarkTabsTab('Icon', { side: 'left' }, [\n fixed ? undefined : cnMixSpace({ mR: size === 's' ? '2xs' : 'xs' }),\n ])}\n size={size}\n />\n )}\n {!fixed && (\n <>\n <Text align=\"left\" className={cnBookmarkTabsTab('Label')} size={size}>\n {label}\n </Text>\n {RightIcon && (\n <RightIcon\n className={cnBookmarkTabsTab('Icon', { side: 'right' }, [\n cnMixSpace({ mL: 'xs' }),\n ])}\n size=\"xs\"\n view=\"secondary\"\n />\n )}\n {onClose && (\n <Button\n size=\"xs\"\n onlyIcon\n ref={closeButtonRef}\n type=\"button\"\n view=\"clear\"\n onKeyDown={onCloseKeydown}\n tabIndex={-1}\n className={cnBookmarkTabsTab('Button', [\n cnMixSpace({ mL: 'xs' }),\n ])}\n onClick={onClose}\n iconLeft={IconClose}\n />\n )}\n </>\n )}\n </Tag>\n );\n};\n\nexport const BookmarkTabsTab = forwardRef(\n BookmarkTabsTabRender,\n) as BookmarkTabsTabComponent;\n"],"mappings":"i7BAAA,8BAEA,OAASA,SAAT,KAA0B,yBAA1B,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,MAA5B,KAA0C,OAA1C,CAEA,OAASC,MAAT,oBACA,OAASC,IAAT,kBACA,OAASC,UAAT,iCACA,OAASC,UAAT,8BACA,OAASC,QAAQ,GAAIC,GAArB,0BAIA,MAAO,IAAMC,kBAAiB,CAAGD,EAAE,CAAC,iBAAD,CAA5B,CAEP,GAAME,sBAAqB,CAAG,SAC5BC,CAD4B,CAE5BC,CAF4B,CAGzB,IAEDC,EAFC,CAqBCF,CArBD,CAEDE,KAFC,CAGSC,CAHT,CAqBCH,CArBD,CAGDI,QAHC,CAIUC,CAJV,CAqBCL,CArBD,CAIDM,SAJC,GAqBCN,CArBD,CAKDO,EALC,CAKGC,CALH,YAKS,KALT,GAMDC,CANC,CAqBCT,CArBD,CAMDS,OANC,CAODC,CAPC,CAqBCV,CArBD,CAODU,IAPC,CAQDC,CARC,CAqBCX,CArBD,CAQDW,IARC,CASDC,CATC,CAqBCZ,CArBD,CASDY,MATC,CAUDC,CAVC,CAqBCb,CArBD,CAUDa,KAVC,CAWDC,CAXC,CAqBCd,CArBD,CAWDc,MAXC,CAYDC,CAZC,CAqBCf,CArBD,CAYDe,OAZC,CAaDC,CAbC,CAqBChB,CArBD,CAaDgB,OAbC,CAcUC,CAdV,CAqBCjB,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OAD+B,qBACvC,EAAiBC,KAAjB,EACD,CANuD,CAO3C,OAAT,GAAAJ,CAAI,EAAyB,OAAT,GAAAA,CAPgC,WAQtDf,CARsD,WAQtDA,CARsD,QAQtDA,CAAO,CAAGc,CAAH,CAR+C,CAUzD,CA8DS,CAOE,QAAQ,CAAE,CAAC,CAPb,CAQE,SAAS,CAAEhC,iBAAiB,CAAC,QAAD,CAAW,CACrCH,UAAU,CAAC,CAAE2C,EAAE,CAAE,IAAN,CAAD,CAD2B,CAAX,CAR9B,CAWE,OAAO,CAAEtB,CAXX,CAYE,QAAQ,CAAE5B,SAZZ,EAdJ,CAnCJ,CAoEH,CAxHD,CA0HA,MAAO,IAAMoD,gBAAe,CAAGlD,UAAU,CACvCS,qBADuC,CAAlC"}
|
|
@@ -36,6 +36,7 @@ export declare type BookmarkTabsPropOnChange<ITEM> = (value: ITEM, params: {
|
|
|
36
36
|
}) => void;
|
|
37
37
|
export declare type BookmarkTabsRenderItemProps<ITEM> = {
|
|
38
38
|
item: ITEM;
|
|
39
|
+
hovered?: boolean;
|
|
39
40
|
onClick: React.MouseEventHandler;
|
|
40
41
|
active?: boolean;
|
|
41
42
|
onClose?: React.MouseEventHandler;
|
|
@@ -45,7 +46,6 @@ export declare type BookmarkTabsRenderItemProps<ITEM> = {
|
|
|
45
46
|
bordered?: boolean;
|
|
46
47
|
tabWidth?: string;
|
|
47
48
|
tabRef?: React.RefObject<HTMLElement>;
|
|
48
|
-
controlRef?: React.RefObject<HTMLElement>;
|
|
49
49
|
} & Omit<BookmarkTabsItemDefault, 'key' | 'ref'>;
|
|
50
50
|
export declare type BookmarkTabsPropRenderItem<ITEM> = (props: BookmarkTabsRenderItemProps<ITEM>) => React.ReactElement | null;
|
|
51
51
|
export declare type BookmarkTabsProps<ITEM = BookmarkTabsItemDefault> = PropsWithHTMLAttributesAndRef<{
|
|
@@ -77,6 +77,7 @@ export declare type BookmarkTabsProps<ITEM = BookmarkTabsItemDefault> = PropsWit
|
|
|
77
77
|
});
|
|
78
78
|
export declare type BookmarkTabsComponent = <ITEM>(props: BookmarkTabsProps<ITEM>) => React.ReactElement | null;
|
|
79
79
|
export declare type BookmarkTabsTabProps<AS extends AsTags = 'div'> = PropsWithAsAttributes<{
|
|
80
|
+
hovered?: boolean;
|
|
80
81
|
size: BookmarkTabsPropSize;
|
|
81
82
|
form: BookmarkTabsPropForm;
|
|
82
83
|
view: BookmarkTabsPropView;
|
|
@@ -84,7 +85,6 @@ export declare type BookmarkTabsTabProps<AS extends AsTags = 'div'> = PropsWithA
|
|
|
84
85
|
tabWidth?: string;
|
|
85
86
|
bordered?: boolean;
|
|
86
87
|
tabRef?: React.RefObject<HTMLElement>;
|
|
87
|
-
controlRef?: React.RefObject<HTMLElement>;
|
|
88
88
|
fixed?: boolean;
|
|
89
89
|
onClose?: React.ReactEventHandler;
|
|
90
90
|
}, AS> & Omit<BookmarkTabsItemDefault, 'key' | 'attributes' | 'ref'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["bookmarkTabsPropSize","bookmarkTabsPropSizeDefault","bookmarkTabsPropForm","bookmarkTabsPropFormDefault","bookmarkTabsPropView","bookmarkTabsPropViewDefault"],"sources":["../../../../../src/components/BookmarkTabsCanary/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { AsAttributes, AsTags } from '##/utils/types/AsTags';\nimport { PropsWithAsAttributes } from '##/utils/types/PropsWithAsAttributes';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const bookmarkTabsPropSize = ['m', 's'] as const;\nexport type BookmarkTabsPropSize = typeof bookmarkTabsPropSize[number];\nexport const bookmarkTabsPropSizeDefault: BookmarkTabsPropSize =\n bookmarkTabsPropSize[0];\n\nexport const bookmarkTabsPropForm = ['brick', 'round'] as const;\nexport type BookmarkTabsPropForm = typeof bookmarkTabsPropForm[number];\nexport const bookmarkTabsPropFormDefault: BookmarkTabsPropForm =\n bookmarkTabsPropForm[0];\n\nexport const bookmarkTabsPropView = ['ghost', 'clear'] as const;\nexport type BookmarkTabsPropView = typeof bookmarkTabsPropView[number];\nexport const bookmarkTabsPropViewDefault: BookmarkTabsPropView =\n bookmarkTabsPropView[0];\n\nexport type BookmarkTabsItemDefault = {\n key: string | number;\n label?: string | number;\n leftIcon?: IconComponent;\n rightIcon?: IconComponent;\n fixed?: boolean;\n as?: AsTags;\n ref?: React.RefObject<HTMLElement>;\n attributes?: AsAttributes;\n};\n\nexport type BookmarkTabsPropGetItemKey<ITEM> = (item: ITEM) => string | number;\nexport type BookmarkTabsPropGetItemLabel<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\nexport type BookmarkTabsPropGetItemLeftIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\nexport type BookmarkTabsPropGetItemRightIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\nexport type BookmarkTabsPropGetItemFixed<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\nexport type BookmarkTabsPropGetItemAs<ITEM> = (\n item: ITEM,\n) => AsTags | undefined;\nexport type BookmarkTabsPropGetItemRef<ITEM> = (\n item: ITEM,\n) => React.RefObject<HTMLElement> | undefined;\nexport type BookmarkTabsPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes | undefined;\n\nexport type BookmarkTabsPropOnChange<ITEM> = (\n value: ITEM,\n params: {\n e: React.MouseEvent;\n id?: string;\n },\n) => void;\n\nexport type BookmarkTabsRenderItemProps<ITEM> = {\n item: ITEM;\n onClick: React.MouseEventHandler;\n active?: boolean;\n onClose?: React.MouseEventHandler;\n size: BookmarkTabsPropSize;\n form: BookmarkTabsPropForm;\n view: BookmarkTabsPropView;\n bordered?: boolean;\n tabWidth?: string;\n tabRef?: React.RefObject<HTMLElement>;\n
|
|
1
|
+
{"version":3,"file":"types.js","names":["bookmarkTabsPropSize","bookmarkTabsPropSizeDefault","bookmarkTabsPropForm","bookmarkTabsPropFormDefault","bookmarkTabsPropView","bookmarkTabsPropViewDefault"],"sources":["../../../../../src/components/BookmarkTabsCanary/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { AsAttributes, AsTags } from '##/utils/types/AsTags';\nimport { PropsWithAsAttributes } from '##/utils/types/PropsWithAsAttributes';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const bookmarkTabsPropSize = ['m', 's'] as const;\nexport type BookmarkTabsPropSize = typeof bookmarkTabsPropSize[number];\nexport const bookmarkTabsPropSizeDefault: BookmarkTabsPropSize =\n bookmarkTabsPropSize[0];\n\nexport const bookmarkTabsPropForm = ['brick', 'round'] as const;\nexport type BookmarkTabsPropForm = typeof bookmarkTabsPropForm[number];\nexport const bookmarkTabsPropFormDefault: BookmarkTabsPropForm =\n bookmarkTabsPropForm[0];\n\nexport const bookmarkTabsPropView = ['ghost', 'clear'] as const;\nexport type BookmarkTabsPropView = typeof bookmarkTabsPropView[number];\nexport const bookmarkTabsPropViewDefault: BookmarkTabsPropView =\n bookmarkTabsPropView[0];\n\nexport type BookmarkTabsItemDefault = {\n key: string | number;\n label?: string | number;\n leftIcon?: IconComponent;\n rightIcon?: IconComponent;\n fixed?: boolean;\n as?: AsTags;\n ref?: React.RefObject<HTMLElement>;\n attributes?: AsAttributes;\n};\n\nexport type BookmarkTabsPropGetItemKey<ITEM> = (item: ITEM) => string | number;\nexport type BookmarkTabsPropGetItemLabel<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\nexport type BookmarkTabsPropGetItemLeftIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\nexport type BookmarkTabsPropGetItemRightIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\nexport type BookmarkTabsPropGetItemFixed<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\nexport type BookmarkTabsPropGetItemAs<ITEM> = (\n item: ITEM,\n) => AsTags | undefined;\nexport type BookmarkTabsPropGetItemRef<ITEM> = (\n item: ITEM,\n) => React.RefObject<HTMLElement> | undefined;\nexport type BookmarkTabsPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes | undefined;\n\nexport type BookmarkTabsPropOnChange<ITEM> = (\n value: ITEM,\n params: {\n e: React.MouseEvent;\n id?: string;\n },\n) => void;\n\nexport type BookmarkTabsRenderItemProps<ITEM> = {\n item: ITEM;\n hovered?: boolean;\n onClick: React.MouseEventHandler;\n active?: boolean;\n onClose?: React.MouseEventHandler;\n size: BookmarkTabsPropSize;\n form: BookmarkTabsPropForm;\n view: BookmarkTabsPropView;\n bordered?: boolean;\n tabWidth?: string;\n tabRef?: React.RefObject<HTMLElement>;\n} & Omit<BookmarkTabsItemDefault, 'key' | 'ref'>;\n\nexport type BookmarkTabsPropRenderItem<ITEM> = (\n props: BookmarkTabsRenderItemProps<ITEM>,\n) => React.ReactElement | null;\n\nexport type BookmarkTabsProps<ITEM = BookmarkTabsItemDefault> =\n PropsWithHTMLAttributesAndRef<\n {\n size?: BookmarkTabsPropSize;\n form?: BookmarkTabsPropForm;\n view?: BookmarkTabsPropView;\n items: ITEM[];\n value?: ITEM | null;\n getItemKey?: BookmarkTabsPropGetItemKey<ITEM>;\n getItemLabel?: BookmarkTabsPropGetItemLabel<ITEM>;\n getItemLeftIcon?: BookmarkTabsPropGetItemLeftIcon<ITEM>;\n getItemRightIcon?: BookmarkTabsPropGetItemRightIcon<ITEM>;\n getItemFixed?: BookmarkTabsPropGetItemFixed<ITEM>;\n getItemAs?: BookmarkTabsPropGetItemAs<ITEM>;\n getItemRef?: BookmarkTabsPropGetItemRef<ITEM>;\n getItemAttributes?: BookmarkTabsPropGetItemAttributes<ITEM>;\n children?: never;\n withNavigationButtons?: boolean;\n onCreate?: React.MouseEventHandler;\n onRemove?: (item: ITEM, params: { e: React.MouseEvent }) => void;\n onChange?: BookmarkTabsPropOnChange<ITEM>;\n renderItem?: BookmarkTabsPropRenderItem<ITEM>;\n },\n HTMLDivElement\n > &\n (ITEM extends { key: string | number }\n ? {}\n : {\n getItemKey: BookmarkTabsPropGetItemKey<ITEM>;\n });\n\nexport type BookmarkTabsComponent = <ITEM>(\n props: BookmarkTabsProps<ITEM>,\n) => React.ReactElement | null;\n\nexport type BookmarkTabsTabProps<AS extends AsTags = 'div'> =\n PropsWithAsAttributes<\n {\n hovered?: boolean;\n size: BookmarkTabsPropSize;\n form: BookmarkTabsPropForm;\n view: BookmarkTabsPropView;\n active?: boolean;\n tabWidth?: string;\n bordered?: boolean;\n tabRef?: React.RefObject<HTMLElement>;\n fixed?: boolean;\n onClose?: React.ReactEventHandler;\n },\n AS\n > &\n Omit<BookmarkTabsItemDefault, 'key' | 'attributes' | 'ref'>;\n\nexport type BookmarkTabsTabComponent = <AS extends AsTags = 'div'>(\n props: BookmarkTabsTabProps<AS>,\n) => React.ReactElement | null;\n"],"mappings":"AAOA,MAAO,IAAMA,qBAAoB,CAAG,CAAC,GAAD,CAAM,GAAN,CAA7B,CAEP,MAAO,IAAMC,4BAAiD,CAC5DD,oBAAoB,CAAC,CAAD,CADf,CAGP,MAAO,IAAME,qBAAoB,CAAG,CAAC,OAAD,CAAU,OAAV,CAA7B,CAEP,MAAO,IAAMC,4BAAiD,CAC5DD,oBAAoB,CAAC,CAAD,CADf,CAGP,MAAO,IAAME,qBAAoB,CAAG,CAAC,OAAD,CAAU,OAAV,CAA7B,CAEP,MAAO,IAAMC,4BAAiD,CAC5DD,oBAAoB,CAAC,CAAD,CADf"}
|
|
@@ -8,7 +8,7 @@ declare type UseBookmarkTabsProps<ITEM = BookmarkTabsItemDefault> = {
|
|
|
8
8
|
size: BookmarkTabsPropSize;
|
|
9
9
|
};
|
|
10
10
|
export declare const useBookmarkTabs: <ITEM>(props: UseBookmarkTabsProps<ITEM>) => {
|
|
11
|
-
refs: import("react").RefObject<
|
|
11
|
+
refs: import("react").RefObject<HTMLDivElement>[];
|
|
12
12
|
containerRef: import("react").RefObject<HTMLDivElement>;
|
|
13
13
|
wrapperRef: import("react").RefObject<HTMLDivElement>;
|
|
14
14
|
fixedTabsRef: import("react").RefObject<HTMLDivElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBookmarkTabs.js","names":["useLayoutEffect","useMemo","useState","useRefs","MAX_TAB_SIZE","useBookmarkTabs","props","items","getItemFixed","withNavigationButtons","refs","length","wrapperRef","containerRef","fixedTabsRef","otherTabsRef","controlsRef","addButtonRef","sizes","setSizes","showControls","setShowControls","fixedTabs","otherTabs","forEach","item","push","ref","resizeObserver","ResizeObserver","containerWidth","current","offsetWidth","fixedWidth","scrollWidth","otherWidth","itemSize","Math","min","Array","from","fill","observe","disconnect","navigate","type","container","i","offsetLeft","scrollLeft","index","node","scrollTo","left","behavior"],"sources":["../../../../../src/components/BookmarkTabsCanary/useBookmarkTabs.ts"],"sourcesContent":["import { useLayoutEffect, useMemo, useState } from 'react';\n\nimport { useRefs } from '##/hooks/useRefs';\n\nimport {\n BookmarkTabsItemDefault,\n BookmarkTabsPropGetItemFixed,\n BookmarkTabsPropSize,\n} from './types';\n\ntype UseBookmarkTabsProps<ITEM = BookmarkTabsItemDefault> = {\n items: ITEM[];\n getItemFixed: BookmarkTabsPropGetItemFixed<ITEM>;\n withNavigationButtons?: boolean;\n withAddButton?: boolean;\n size: BookmarkTabsPropSize;\n};\n\nconst MAX_TAB_SIZE = 200;\n\nexport const useBookmarkTabs = <ITEM>(props: UseBookmarkTabsProps<ITEM>) => {\n const { items, getItemFixed, withNavigationButtons } = props;\n\n const refs = useRefs<
|
|
1
|
+
{"version":3,"file":"useBookmarkTabs.js","names":["useLayoutEffect","useMemo","useState","useRefs","MAX_TAB_SIZE","useBookmarkTabs","props","items","getItemFixed","withNavigationButtons","refs","length","wrapperRef","containerRef","fixedTabsRef","otherTabsRef","controlsRef","addButtonRef","sizes","setSizes","showControls","setShowControls","fixedTabs","otherTabs","forEach","item","push","ref","resizeObserver","ResizeObserver","containerWidth","current","offsetWidth","fixedWidth","scrollWidth","otherWidth","itemSize","Math","min","Array","from","fill","observe","disconnect","navigate","type","container","i","offsetLeft","scrollLeft","index","node","scrollTo","left","behavior"],"sources":["../../../../../src/components/BookmarkTabsCanary/useBookmarkTabs.ts"],"sourcesContent":["import { useLayoutEffect, useMemo, useState } from 'react';\n\nimport { useRefs } from '##/hooks/useRefs';\n\nimport {\n BookmarkTabsItemDefault,\n BookmarkTabsPropGetItemFixed,\n BookmarkTabsPropSize,\n} from './types';\n\ntype UseBookmarkTabsProps<ITEM = BookmarkTabsItemDefault> = {\n items: ITEM[];\n getItemFixed: BookmarkTabsPropGetItemFixed<ITEM>;\n withNavigationButtons?: boolean;\n withAddButton?: boolean;\n size: BookmarkTabsPropSize;\n};\n\nconst MAX_TAB_SIZE = 200;\n\nexport const useBookmarkTabs = <ITEM>(props: UseBookmarkTabsProps<ITEM>) => {\n const { items, getItemFixed, withNavigationButtons } = props;\n\n const refs = useRefs<HTMLDivElement>(items.length);\n\n const [\n wrapperRef,\n containerRef,\n fixedTabsRef,\n otherTabsRef,\n controlsRef,\n addButtonRef,\n ] = useRefs<HTMLDivElement>(6);\n\n const [sizes, setSizes] = useState<string[]>([]);\n\n const [showControls, setShowControls] = useState(false);\n\n const { fixedTabs, otherTabs } = useMemo(() => {\n const fixedTabs: ITEM[] = [];\n const otherTabs: ITEM[] = [];\n\n items.forEach((item) => {\n if (getItemFixed(item)) {\n fixedTabs.push(item);\n } else {\n otherTabs.push(item);\n }\n });\n\n return {\n fixedTabs,\n otherTabs,\n };\n }, [items, getItemFixed]);\n\n const navigate = (type: 'next' | 'prev') => {\n const container = wrapperRef.current;\n if (container) {\n for (let i = 0; i < refs.length; i++) {\n const ref = refs[i];\n if (ref.current) {\n if (\n ref.current.offsetLeft >=\n container.offsetLeft + container.scrollLeft\n ) {\n const index = i + (type === 'next' ? 1 : -1);\n const node = refs[index]?.current;\n if (node) {\n container.scrollTo({\n left: node.offsetLeft - container.offsetLeft,\n behavior: 'smooth',\n });\n }\n return;\n }\n }\n }\n }\n };\n\n useLayoutEffect(() => {\n const refs = [\n containerRef,\n fixedTabsRef,\n wrapperRef,\n otherTabsRef,\n controlsRef,\n ];\n const resizeObserver = new ResizeObserver(() => {\n const containerWidth = containerRef.current?.offsetWidth ?? 0;\n const fixedWidth = fixedTabsRef.current?.offsetWidth ?? 0;\n\n const showControls =\n (fixedTabsRef.current?.scrollWidth ?? 0) +\n (otherTabsRef.current?.scrollWidth ?? 0) >\n containerWidth - (addButtonRef.current?.offsetWidth ?? 0) &&\n !!withNavigationButtons;\n\n const otherWidth =\n containerWidth -\n (controlsRef.current?.offsetWidth ?? 0) -\n (addButtonRef.current?.offsetWidth ?? 0) -\n fixedWidth;\n\n const itemSize = `${\n otherWidth\n ? Math.min(otherWidth / otherTabs.length, MAX_TAB_SIZE)\n : MAX_TAB_SIZE\n }px`;\n setSizes(Array.from<string>({ length: otherTabs.length }).fill(itemSize));\n setShowControls(showControls);\n });\n\n for (const ref of refs) {\n ref.current && resizeObserver.observe(ref.current);\n }\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [\n otherTabs.length,\n fixedTabs.length,\n withNavigationButtons,\n wrapperRef.current,\n containerRef.current,\n fixedTabsRef.current,\n controlsRef.current,\n ]);\n\n return {\n refs,\n containerRef,\n wrapperRef,\n fixedTabsRef,\n otherTabsRef,\n showControls,\n fixedTabs,\n otherTabs,\n navigate,\n sizes,\n controlsRef,\n addButtonRef,\n };\n};\n"],"mappings":"iEAAA,OAASA,eAAT,CAA0BC,OAA1B,CAAmCC,QAAnC,KAAmD,OAAnD,CAEA,OAASC,OAAT,2BAgBA,GAAMC,aAAY,CAAG,GAArB,CAEA,MAAO,IAAMC,gBAAe,CAAG,SAAOC,CAAP,CAA6C,IAClEC,EADkE,CACnBD,CADmB,CAClEC,KADkE,CAC3DC,CAD2D,CACnBF,CADmB,CAC3DE,YAD2D,CAC7CC,CAD6C,CACnBH,CADmB,CAC7CG,qBAD6C,CAGpEC,CAAI,CAA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A,CARK,CASLqB,QAAQ,CApFO,QAAXA,SAAW,CAACC,CAAD,CAA2B,CAC1C,GAAMC,EAAS,CAAGlC,CAAU,CAACmB,OAA7B,CACA,GAAIe,CAAJ,CACE,IAAK,GACGnB,EADH,CAAIoB,CAAC,CAAG,CAAb,CAAgBA,CAAC,CAAGrC,CAAI,CAACC,MAAzB,CAAiCoC,CAAC,EAAlC,CAEE,GADMpB,CACN,CADYjB,CAAI,CAACqC,CAAD,CAChB,CAAIpB,CAAG,CAACI,OAAR,EAEIJ,CAAG,CAACI,OAAJ,CAAYiB,UAAZ,EACAF,CAAS,CAACE,UAAV,CAAuBF,CAAS,CAACG,UAHrC,CAII,OACMC,CAAK,CAAGH,CAAC,EAAa,MAAT,GAAAF,CAAI,CAAc,CAAd,CAAkB,CAAC,CAA3B,CADf,CAEMM,CAAI,WAAGzC,CAAI,CAACwC,CAAD,CAAP,qBAAG,EAAanB,OAF1B,CASA,YANIoB,CAMJ,EALEL,CAAS,CAACM,QAAV,CAAmB,CACjBC,IAAI,CAAEF,CAAI,CAACH,UAAL,CAAkBF,CAAS,CAACE,UADjB,CAEjBM,QAAQ,CAAE,QAFO,CAAnB,CAKF,CACD,CAIR,CAoDM,CAULpC,KAAK,CAALA,CAVK,CAWLF,WAAW,CAAXA,CAXK,CAYLC,YAAY,CAAZA,CAZK,CAcR,CA7HM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["value","items","getItemKey","getItemLabel","getItemDisabled","getItemAttributes","onChange","name","direction","size","view","disabled","className","getItemRef"],_excluded2=["className"];import"./CheckboxGroup.css";import React,{forwardRef}from"react";import{useChoiceGroup}from"../../hooks/useChoiceGroup/useChoiceGroup";import{cn}from"../../utils/bem";import{Checkbox}from"../Checkbox/Checkbox";import{withDefaultGetters}from"./helper";import{checkboxGroupDefaultDirection,checkboxGroupDefaultSize,checkboxGroupDefaultView}from"./types";export var cnCheckboxGroup=cn("CheckboxGroup");var CheckboxGroupRender=function(a,b){var c=withDefaultGetters(a),d=c.value,e=void 0===d?null:d,f=c.items,g=c.getItemKey,h=c.getItemLabel,i=c.getItemDisabled,j=c.getItemAttributes,k=c.onChange,l=c.name,m=c.
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["value","items","getItemKey","getItemLabel","getItemDisabled","getItemAttributes","onChange","name","align","direction","size","view","disabled","className","getItemRef"],_excluded2=["className"];import"./CheckboxGroup.css";import React,{forwardRef}from"react";import{useChoiceGroup}from"../../hooks/useChoiceGroup/useChoiceGroup";import{cn}from"../../utils/bem";import{Checkbox}from"../Checkbox/Checkbox";import{withDefaultGetters}from"./helper";import{checkboxGroupDefaultAlign,checkboxGroupDefaultDirection,checkboxGroupDefaultSize,checkboxGroupDefaultView}from"./types";export var cnCheckboxGroup=cn("CheckboxGroup");var CheckboxGroupRender=function(a,b){var c=withDefaultGetters(a),d=c.value,e=void 0===d?null:d,f=c.items,g=c.getItemKey,h=c.getItemLabel,i=c.getItemDisabled,j=c.getItemAttributes,k=c.onChange,l=c.name,m=c.align,n=void 0===m?checkboxGroupDefaultAlign:m,o=c.direction,p=void 0===o?checkboxGroupDefaultDirection:o,q=c.size,r=void 0===q?checkboxGroupDefaultSize:q,s=c.view,t=void 0===s?checkboxGroupDefaultView:s,u=c.disabled,v=c.className,w=c.getItemRef,x=_objectWithoutProperties(c,_excluded),y=useChoiceGroup({value:e,getKey:function getKey(a){var b;return null!==(b=g(a))&&void 0!==b?b:h(a)},callBack:k,multiple:!0}),z=y.getOnChange,A=y.getChecked;return React.createElement("div",Object.assign({},x,{ref:b,className:cnCheckboxGroup({direction:p,size:r,view:t},[v])}),f.map(function(a){var b,c,d=null!==(b=j(a))&&void 0!==b?b:{},e=d.className,f=_objectWithoutProperties(d,_excluded2);return React.createElement(Checkbox,Object.assign({key:null!==(c=g(a))&&void 0!==c?c:h(a),align:n,label:h(a),size:r,view:t,name:l,ref:w(a),disabled:void 0!==u&&u||(null===i||void 0===i?void 0:i(a)),checked:A(a),onChange:function(b){var c=b.e;return z(a)(c)},className:cnCheckboxGroup("Item",[e])},f))}))};export var CheckboxGroup=forwardRef(CheckboxGroupRender);export*from"./types";
|
|
2
2
|
//# sourceMappingURL=CheckboxGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxGroup.js","names":["React","forwardRef","useChoiceGroup","cn","Checkbox","withDefaultGetters","checkboxGroupDefaultDirection","checkboxGroupDefaultSize","checkboxGroupDefaultView","cnCheckboxGroup","CheckboxGroupRender","props","ref","value","items","getItemKey","getItemLabel","getItemDisabled","getItemAttributes","onChange","name","direction","size","view","disabled","className","getItemRef","otherProps","getKey","item","callBack","multiple","getOnChange","getChecked","map","atributes","e","CheckboxGroup"],"sources":["../../../../../src/components/CheckboxGroup/CheckboxGroup.tsx"],"sourcesContent":["import './CheckboxGroup.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { useChoiceGroup } from '../../hooks/useChoiceGroup/useChoiceGroup';\nimport { cn } from '../../utils/bem';\nimport { Checkbox } from '../Checkbox/Checkbox';\nimport { withDefaultGetters } from './helper';\nimport {\n CheckboxGroupComponent,\n checkboxGroupDefaultDirection,\n checkboxGroupDefaultSize,\n checkboxGroupDefaultView,\n CheckboxGroupProps,\n} from './types';\n\nexport const cnCheckboxGroup = cn('CheckboxGroup');\n\nconst CheckboxGroupRender = (\n props: CheckboxGroupProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n value = null,\n items,\n getItemKey,\n getItemLabel,\n getItemDisabled,\n getItemAttributes,\n onChange,\n name,\n direction = checkboxGroupDefaultDirection,\n size = checkboxGroupDefaultSize,\n view = checkboxGroupDefaultView,\n disabled = false,\n className,\n getItemRef,\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: true,\n });\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnCheckboxGroup({ direction, size, view }, [className])}\n >\n {items.map((item) => {\n const { className, ...atributes } = getItemAttributes(item) ?? {};\n return (\n <Checkbox\n key={getItemKey(item) ?? getItemLabel(item)}\n label={getItemLabel(item)}\n size={size}\n view={view}\n name={name}\n ref={getItemRef(item)}\n disabled={disabled || getItemDisabled?.(item)}\n checked={getChecked(item)}\n onChange={({ e }) => getOnChange(item)(e)}\n className={cnCheckboxGroup('Item', [className])}\n {...atributes}\n />\n );\n })}\n </div>\n );\n};\n\nexport const CheckboxGroup = forwardRef(\n CheckboxGroupRender,\n) as CheckboxGroupComponent;\n\nexport * from './types';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CheckboxGroup.js","names":["React","forwardRef","useChoiceGroup","cn","Checkbox","withDefaultGetters","checkboxGroupDefaultAlign","checkboxGroupDefaultDirection","checkboxGroupDefaultSize","checkboxGroupDefaultView","cnCheckboxGroup","CheckboxGroupRender","props","ref","value","items","getItemKey","getItemLabel","getItemDisabled","getItemAttributes","onChange","name","align","direction","size","view","disabled","className","getItemRef","otherProps","getKey","item","callBack","multiple","getOnChange","getChecked","map","atributes","e","CheckboxGroup"],"sources":["../../../../../src/components/CheckboxGroup/CheckboxGroup.tsx"],"sourcesContent":["import './CheckboxGroup.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { useChoiceGroup } from '../../hooks/useChoiceGroup/useChoiceGroup';\nimport { cn } from '../../utils/bem';\nimport { Checkbox } from '../Checkbox/Checkbox';\nimport { withDefaultGetters } from './helper';\nimport {\n CheckboxGroupComponent,\n checkboxGroupDefaultAlign,\n checkboxGroupDefaultDirection,\n checkboxGroupDefaultSize,\n checkboxGroupDefaultView,\n CheckboxGroupProps,\n} from './types';\n\nexport const cnCheckboxGroup = cn('CheckboxGroup');\n\nconst CheckboxGroupRender = (\n props: CheckboxGroupProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n value = null,\n items,\n getItemKey,\n getItemLabel,\n getItemDisabled,\n getItemAttributes,\n onChange,\n name,\n align = checkboxGroupDefaultAlign,\n direction = checkboxGroupDefaultDirection,\n size = checkboxGroupDefaultSize,\n view = checkboxGroupDefaultView,\n disabled = false,\n className,\n getItemRef,\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: true,\n });\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnCheckboxGroup({ direction, size, view }, [className])}\n >\n {items.map((item) => {\n const { className, ...atributes } = getItemAttributes(item) ?? {};\n return (\n <Checkbox\n key={getItemKey(item) ?? getItemLabel(item)}\n align={align}\n label={getItemLabel(item)}\n size={size}\n view={view}\n name={name}\n ref={getItemRef(item)}\n disabled={disabled || getItemDisabled?.(item)}\n checked={getChecked(item)}\n onChange={({ e }) => getOnChange(item)(e)}\n className={cnCheckboxGroup('Item', [className])}\n {...atributes}\n />\n );\n })}\n </div>\n );\n};\n\nexport const CheckboxGroup = forwardRef(\n CheckboxGroupRender,\n) as CheckboxGroupComponent;\n\nexport * from './types';\n"],"mappings":"wSAAA,4BAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,cAAT,iDACA,OAASC,EAAT,uBACA,OAASC,QAAT,4BACA,OAASC,kBAAT,gBACA,OAEEC,yBAFF,CAGEC,6BAHF,CAIEC,wBAJF,CAKEC,wBALF,eASA,MAAO,IAAMC,gBAAe,CAAGP,EAAE,CAAC,eAAD,CAA1B,CAEP,GAAMQ,oBAAmB,CAAG,SAC1BC,CAD0B,CAE1BC,CAF0B,CAGvB,OAkBCR,kBAAkB,CAACO,CAAD,CAlBnB,KAEDE,KAFC,CAEDA,CAFC,YAEO,IAFP,GAGDC,CAHC,GAGDA,KAHC,CAIDC,CAJC,GAIDA,UAJC,CAKDC,CALC,GAKDA,YALC,CAMDC,CANC,GAMDA,eAN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,CAACG,CAAD,CAPjB,CAQE,QAAQ,CAAE,uBAAYb,CAAZ,WAAYA,CAAZ,QAAYA,CAAe,CAAGa,CAAH,CAA3B,CARZ,CASE,OAAO,CAAEI,CAAU,CAACJ,CAAD,CATrB,CAUE,QAAQ,CAAE,eAAGO,EAAH,GAAGA,CAAH,OAAWJ,EAAW,CAACH,CAAD,CAAX,CAAkBO,CAAlB,CAAX,CAVZ,CAWE,SAAS,CAAE5B,eAAe,CAAC,MAAD,CAAS,CAACiB,CAAD,CAAT,CAX5B,EAYMU,CAZN,EAeH,CAlBA,CALH,CA0BH,CAzDD,CA2DA,MAAO,IAAME,cAAa,CAAGtC,UAAU,CACrCU,mBADqC,CAAhC,CAIP"}
|
|
@@ -14,6 +14,7 @@ export declare const withDefaultGetters: (props: CheckboxGroupProps) => {
|
|
|
14
14
|
}) => void;
|
|
15
15
|
name?: string | undefined;
|
|
16
16
|
direction?: "row" | "column" | undefined;
|
|
17
|
+
align?: "center" | "top" | undefined;
|
|
17
18
|
size?: "m" | "s" | "xs" | "l" | undefined;
|
|
18
19
|
view?: "primary" | "ghost" | undefined;
|
|
19
20
|
disabled?: boolean | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PropsWithHTMLAttributesAndRef } from
|
|
2
|
+
import { PropsWithHTMLAttributesAndRef } from "../../utils/types/PropsWithHTMLAttributes";
|
|
3
3
|
declare type CheckboxGroupPropAttributes = Omit<JSX.IntrinsicElements['label'], 'ref' | 'onChange' | 'onFocus' | 'children' | 'onBlur'>;
|
|
4
4
|
export declare type CheckboxGroupDefaultItem = {
|
|
5
5
|
key?: string | number;
|
|
@@ -8,15 +8,18 @@ export declare type CheckboxGroupDefaultItem = {
|
|
|
8
8
|
attributes?: CheckboxGroupPropAttributes;
|
|
9
9
|
ref?: React.RefObject<HTMLLabelElement>;
|
|
10
10
|
};
|
|
11
|
-
export declare const
|
|
12
|
-
export declare type
|
|
13
|
-
export declare const checkboxGroupDefaultDirection:
|
|
14
|
-
export declare const
|
|
15
|
-
export declare type CheckboxGroupPropSize = typeof
|
|
11
|
+
export declare const checkboxGroupPropDirections: readonly ["column", "row"];
|
|
12
|
+
export declare type CheckboxGroupPropDirection = typeof checkboxGroupPropDirections[number];
|
|
13
|
+
export declare const checkboxGroupDefaultDirection: CheckboxGroupPropDirection;
|
|
14
|
+
export declare const checkboxGroupPropSizes: readonly ["m", "xs", "s", "l"];
|
|
15
|
+
export declare type CheckboxGroupPropSize = typeof checkboxGroupPropSizes[number];
|
|
16
16
|
export declare const checkboxGroupDefaultSize: CheckboxGroupPropSize;
|
|
17
|
-
export declare const
|
|
18
|
-
export declare type CheckboxGroupPropView = typeof
|
|
17
|
+
export declare const checkboxGroupPropViews: readonly ["primary", "ghost"];
|
|
18
|
+
export declare type CheckboxGroupPropView = typeof checkboxGroupPropViews[number];
|
|
19
19
|
export declare const checkboxGroupDefaultView: CheckboxGroupPropView;
|
|
20
|
+
export declare const checkboxGroupPropAlign: readonly ["center", "top"];
|
|
21
|
+
export declare type CheckboxGroupPropAlign = typeof checkboxGroupPropAlign[number];
|
|
22
|
+
export declare const checkboxGroupDefaultAlign: CheckboxGroupPropAlign;
|
|
20
23
|
export declare type CheckboxGroupPropGetItemKey<ITEM> = (item: ITEM) => string | number | undefined;
|
|
21
24
|
export declare type CheckboxGroupPropGetItemLabel<ITEM> = (item: ITEM) => string;
|
|
22
25
|
export declare type CheckboxGroupPropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;
|
|
@@ -35,7 +38,8 @@ export declare type CheckboxGroupProps<ITEM = CheckboxGroupDefaultItem> = PropsW
|
|
|
35
38
|
value: ITEM[] | null;
|
|
36
39
|
}) => void;
|
|
37
40
|
name?: string;
|
|
38
|
-
direction?:
|
|
41
|
+
direction?: CheckboxGroupPropDirection;
|
|
42
|
+
align?: CheckboxGroupPropAlign;
|
|
39
43
|
size?: CheckboxGroupPropSize;
|
|
40
44
|
view?: CheckboxGroupPropView;
|
|
41
45
|
disabled?: boolean;
|