@consta/uikit 4.32.0 → 4.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/AttachmentCanary/index.d.ts +1 -0
  2. package/AttachmentCanary/index.js +1 -0
  3. package/PaginationCanary/index.d.ts +1 -0
  4. package/PaginationCanary/index.js +1 -0
  5. package/__internal__/src/components/AttachmentCanary/Attachment.css +1 -0
  6. package/__internal__/src/components/AttachmentCanary/AttachmentCanary.d.ts +5 -0
  7. package/__internal__/src/components/AttachmentCanary/AttachmentCanary.js +2 -0
  8. package/__internal__/src/components/AttachmentCanary/AttachmentCanary.js.map +1 -0
  9. package/__internal__/src/components/AttachmentCanary/index.d.ts +1 -0
  10. package/__internal__/src/components/AttachmentCanary/index.js +2 -0
  11. package/__internal__/src/components/AttachmentCanary/index.js.map +1 -0
  12. package/__internal__/src/components/AttachmentCanary/types.d.ts +22 -0
  13. package/__internal__/src/components/AttachmentCanary/types.js +2 -0
  14. package/__internal__/src/components/AttachmentCanary/types.js.map +1 -0
  15. package/__internal__/src/components/CheckboxGroup/CheckboxGroup.js +1 -1
  16. package/__internal__/src/components/CheckboxGroup/CheckboxGroup.js.map +1 -1
  17. package/__internal__/src/components/CheckboxGroup/helper.d.ts +1 -0
  18. package/__internal__/src/components/CheckboxGroup/types.d.ts +13 -9
  19. package/__internal__/src/components/CheckboxGroup/types.js +1 -1
  20. package/__internal__/src/components/CheckboxGroup/types.js.map +1 -1
  21. package/__internal__/src/components/ChoiceGroup/types.d.ts +3 -3
  22. package/__internal__/src/components/ChoiceGroup/types.js.map +1 -1
  23. package/__internal__/src/components/ChoiceGroupDeprecated/ChoiceGroupDeprecated.d.ts +3 -3
  24. package/__internal__/src/components/ChoiceGroupDeprecated/ChoiceGroupDeprecated.js.map +1 -1
  25. package/__internal__/src/components/DateTime/helpers/getHandleSelectDate.d.ts +3 -3
  26. package/__internal__/src/components/DateTime/helpers/getHandleSelectDate.js.map +1 -1
  27. package/__internal__/src/components/DateTime/helpers/types.d.ts +4 -4
  28. package/__internal__/src/components/DateTime/helpers/types.js.map +1 -1
  29. package/__internal__/src/components/DragNDropField/DragNDropFieldTooltip/DragNDropFieldTooltip.js +1 -1
  30. package/__internal__/src/components/DragNDropField/DragNDropFieldTooltip/DragNDropFieldTooltip.js.map +1 -1
  31. package/__internal__/src/components/PaginationCanary/Pagination.css +1 -0
  32. package/__internal__/src/components/PaginationCanary/PaginationArrow/PaginationArrow.css +1 -0
  33. package/__internal__/src/components/PaginationCanary/PaginationArrow/PaginationArrow.d.ts +11 -0
  34. package/__internal__/src/components/PaginationCanary/PaginationArrow/PaginationArrow.js +2 -0
  35. package/__internal__/src/components/PaginationCanary/PaginationArrow/PaginationArrow.js.map +1 -0
  36. package/__internal__/src/components/PaginationCanary/PaginationArrow/index.d.ts +1 -0
  37. package/__internal__/src/components/PaginationCanary/PaginationArrow/index.js +2 -0
  38. package/__internal__/src/components/PaginationCanary/PaginationArrow/index.js.map +1 -0
  39. package/__internal__/src/components/PaginationCanary/PaginationBase/PaginationBase.css +1 -0
  40. package/__internal__/src/components/PaginationCanary/PaginationBase/PaginationBase.d.ts +3 -0
  41. package/__internal__/src/components/PaginationCanary/PaginationBase/PaginationBase.js +2 -0
  42. package/__internal__/src/components/PaginationCanary/PaginationBase/PaginationBase.js.map +1 -0
  43. package/__internal__/src/components/PaginationCanary/PaginationBase/index.d.ts +1 -0
  44. package/__internal__/src/components/PaginationCanary/PaginationBase/index.js +2 -0
  45. package/__internal__/src/components/PaginationCanary/PaginationBase/index.js.map +1 -0
  46. package/__internal__/src/components/PaginationCanary/PaginationCanary.d.ts +3 -0
  47. package/__internal__/src/components/PaginationCanary/PaginationCanary.js +2 -0
  48. package/__internal__/src/components/PaginationCanary/PaginationCanary.js.map +1 -0
  49. package/__internal__/src/components/PaginationCanary/PaginationItem/PaginationItem.css +1 -0
  50. package/__internal__/src/components/PaginationCanary/PaginationItem/PaginationItem.d.ts +3 -0
  51. package/__internal__/src/components/PaginationCanary/PaginationItem/PaginationItem.js +2 -0
  52. package/__internal__/src/components/PaginationCanary/PaginationItem/PaginationItem.js.map +1 -0
  53. package/__internal__/src/components/PaginationCanary/PaginationItem/index.d.ts +1 -0
  54. package/__internal__/src/components/PaginationCanary/PaginationItem/index.js +2 -0
  55. package/__internal__/src/components/PaginationCanary/PaginationItem/index.js.map +1 -0
  56. package/__internal__/src/components/PaginationCanary/PaginationList/PaginationList.css +1 -0
  57. package/__internal__/src/components/PaginationCanary/PaginationList/PaginationList.d.ts +3 -0
  58. package/__internal__/src/components/PaginationCanary/PaginationList/PaginationList.js +2 -0
  59. package/__internal__/src/components/PaginationCanary/PaginationList/PaginationList.js.map +1 -0
  60. package/__internal__/src/components/PaginationCanary/PaginationList/index.d.ts +1 -0
  61. package/__internal__/src/components/PaginationCanary/PaginationList/index.js +2 -0
  62. package/__internal__/src/components/PaginationCanary/PaginationList/index.js.map +1 -0
  63. package/__internal__/src/components/PaginationCanary/PaginationNumberInput/PaginationNumberInput.css +1 -0
  64. package/__internal__/src/components/PaginationCanary/PaginationNumberInput/PaginationNumberInput.d.ts +10 -0
  65. package/__internal__/src/components/PaginationCanary/PaginationNumberInput/PaginationNumberInput.js +2 -0
  66. package/__internal__/src/components/PaginationCanary/PaginationNumberInput/PaginationNumberInput.js.map +1 -0
  67. package/__internal__/src/components/PaginationCanary/PaginationNumberInput/index.d.ts +1 -0
  68. package/__internal__/src/components/PaginationCanary/PaginationNumberInput/index.js +2 -0
  69. package/__internal__/src/components/PaginationCanary/PaginationNumberInput/index.js.map +1 -0
  70. package/__internal__/src/components/PaginationCanary/helpers.d.ts +560 -0
  71. package/__internal__/src/components/PaginationCanary/helpers.js +2 -0
  72. package/__internal__/src/components/PaginationCanary/helpers.js.map +1 -0
  73. package/__internal__/src/components/PaginationCanary/index.d.ts +2 -0
  74. package/__internal__/src/components/PaginationCanary/index.js +2 -0
  75. package/__internal__/src/components/PaginationCanary/index.js.map +1 -0
  76. package/__internal__/src/components/PaginationCanary/types.d.ts +148 -0
  77. package/__internal__/src/components/PaginationCanary/types.js +2 -0
  78. package/__internal__/src/components/PaginationCanary/types.js.map +1 -0
  79. package/__internal__/src/components/PaginationCanary/usePaginationItems.d.ts +19 -0
  80. package/__internal__/src/components/PaginationCanary/usePaginationItems.js +2 -0
  81. package/__internal__/src/components/PaginationCanary/usePaginationItems.js.map +1 -0
  82. package/__internal__/src/components/PaginationCanary/usePaginationKeys.d.ts +10 -0
  83. package/__internal__/src/components/PaginationCanary/usePaginationKeys.js +2 -0
  84. package/__internal__/src/components/PaginationCanary/usePaginationKeys.js.map +1 -0
  85. package/__internal__/src/components/Tabs/Tabs.js +1 -1
  86. package/__internal__/src/components/Tabs/Tabs.js.map +1 -1
  87. package/__internal__/src/components/Tabs/{FitModeDropdownWrapper → TabsFitModeDropdownWrapper}/TabsFitModeDropdownWrapper.d.ts +1 -1
  88. package/__internal__/src/components/Tabs/TabsFitModeDropdownWrapper/TabsFitModeDropdownWrapper.js +2 -0
  89. package/__internal__/src/components/Tabs/TabsFitModeDropdownWrapper/TabsFitModeDropdownWrapper.js.map +1 -0
  90. package/__internal__/src/components/Tabs/TabsFitModeDropdownWrapper/useFittingItems.js.map +1 -0
  91. package/__internal__/src/components/Tabs/TabsFitModeScrollWrapper/TabsFitModeScrollWrapper.js +2 -0
  92. package/__internal__/src/components/Tabs/TabsFitModeScrollWrapper/TabsFitModeScrollWrapper.js.map +1 -0
  93. package/__internal__/src/components/Tabs/TabsFitModeScrollWrapper/__test__/helpers.test.js.map +1 -0
  94. package/__internal__/src/components/Tabs/TabsLine/TabsLine.js.map +1 -0
  95. package/__internal__/src/components/Tabs/TabsListWrapper/TabsListWrapper.d.ts +2 -0
  96. package/__internal__/src/components/Tabs/TabsListWrapper/TabsListWrapper.js +2 -0
  97. package/__internal__/src/components/Tabs/TabsListWrapper/TabsListWrapper.js.map +1 -0
  98. package/__internal__/src/components/Tabs/TabsListWrapper/index.d.ts +1 -0
  99. package/__internal__/src/components/Tabs/TabsListWrapper/index.js +2 -0
  100. package/__internal__/src/components/Tabs/TabsListWrapper/index.js.map +1 -0
  101. package/__internal__/src/components/Tabs/TabsMoreItems/TabsMoreItems.css +1 -0
  102. package/__internal__/src/components/Tabs/TabsMoreItems/TabsMoreItems.js +2 -0
  103. package/__internal__/src/components/Tabs/TabsMoreItems/TabsMoreItems.js.map +1 -0
  104. package/__internal__/src/components/Tabs/TabsTab/TabsTab.js.map +1 -0
  105. package/__internal__/src/components/Tabs/helpers.d.ts +329 -329
  106. package/__internal__/src/components/Tabs/helpers.js +1 -1
  107. package/__internal__/src/components/Tabs/helpers.js.map +1 -1
  108. package/__internal__/src/components/Tabs/index.d.ts +1 -1
  109. package/__internal__/src/components/Tabs/index.js +1 -1
  110. package/__internal__/src/components/Tabs/index.js.map +1 -1
  111. package/__internal__/src/components/Tabs/types.d.ts +3 -2
  112. package/__internal__/src/components/Tabs/types.js.map +1 -1
  113. package/__internal__/src/hooks/useHideElementsInLineCanary/useHideElementsInLineCanary.js +1 -1
  114. package/__internal__/src/hooks/useHideElementsInLineCanary/useHideElementsInLineCanary.js.map +1 -1
  115. package/package.json +1 -1
  116. package/__internal__/src/components/Tabs/FitModeDropdownWrapper/TabsFitModeDropdownWrapper.js +0 -2
  117. package/__internal__/src/components/Tabs/FitModeDropdownWrapper/TabsFitModeDropdownWrapper.js.map +0 -1
  118. package/__internal__/src/components/Tabs/FitModeDropdownWrapper/useFittingItems.js.map +0 -1
  119. package/__internal__/src/components/Tabs/FitModeScrollWrapper/TabsFitModeScrollWrapper.js +0 -2
  120. package/__internal__/src/components/Tabs/FitModeScrollWrapper/TabsFitModeScrollWrapper.js.map +0 -1
  121. package/__internal__/src/components/Tabs/FitModeScrollWrapper/__test__/helpers.test.js.map +0 -1
  122. package/__internal__/src/components/Tabs/Line/TabsLine.js.map +0 -1
  123. package/__internal__/src/components/Tabs/MoreItems/TabsMoreItems.css +0 -1
  124. package/__internal__/src/components/Tabs/MoreItems/TabsMoreItems.js +0 -2
  125. package/__internal__/src/components/Tabs/MoreItems/TabsMoreItems.js.map +0 -1
  126. package/__internal__/src/components/Tabs/Tab/TabsTab.js.map +0 -1
  127. /package/__internal__/src/components/Tabs/{FitModeDropdownWrapper → TabsFitModeDropdownWrapper}/TabsFitModeDropdownWrapper.css +0 -0
  128. /package/__internal__/src/components/Tabs/{FitModeDropdownWrapper → TabsFitModeDropdownWrapper}/useFittingItems.d.ts +0 -0
  129. /package/__internal__/src/components/Tabs/{FitModeDropdownWrapper → TabsFitModeDropdownWrapper}/useFittingItems.js +0 -0
  130. /package/__internal__/src/components/Tabs/{FitModeScrollWrapper → TabsFitModeScrollWrapper}/TabsFitModeScrollWrapper.css +0 -0
  131. /package/__internal__/src/components/Tabs/{FitModeScrollWrapper → TabsFitModeScrollWrapper}/TabsFitModeScrollWrapper.d.ts +0 -0
  132. /package/__internal__/src/components/Tabs/{FitModeScrollWrapper → TabsFitModeScrollWrapper}/__test__/helpers.test.d.ts +0 -0
  133. /package/__internal__/src/components/Tabs/{FitModeScrollWrapper → TabsFitModeScrollWrapper}/__test__/helpers.test.js +0 -0
  134. /package/__internal__/src/components/Tabs/{Line → TabsLine}/TabsLine.css +0 -0
  135. /package/__internal__/src/components/Tabs/{Line → TabsLine}/TabsLine.d.ts +0 -0
  136. /package/__internal__/src/components/Tabs/{Line → TabsLine}/TabsLine.js +0 -0
  137. /package/__internal__/src/components/Tabs/{MoreItems → TabsMoreItems}/TabsMoreItems.d.ts +0 -0
  138. /package/__internal__/src/components/Tabs/{Tab → TabsTab}/TabsTab.css +0 -0
  139. /package/__internal__/src/components/Tabs/{Tab → TabsTab}/TabsTab.d.ts +0 -0
  140. /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
+ .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,SA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AGE,QAAQ,GAHV,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,2 @@
1
+ export*from"./AttachmentCanary";
2
+ //# sourceMappingURL=index.js.map
@@ -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,2 @@
1
+ export var attachmentPropSize=["s","xs","m"];export var attachmentPropSizeDefault=attachmentPropSize[0];
2
+ //# sourceMappingURL=types.js.map
@@ -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,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.direction,n=void 0===m?checkboxGroupDefaultDirection:m,o=c.size,p=void 0===o?checkboxGroupDefaultSize:o,q=c.view,r=void 0===q?checkboxGroupDefaultView:q,s=c.disabled,t=c.className,u=c.getItemRef,v=_objectWithoutProperties(c,_excluded),w=useChoiceGroup({value:e,getKey:function getKey(a){var b;return null!==(b=g(a))&&void 0!==b?b:h(a)},callBack:k,multiple:!0}),x=w.getOnChange,y=w.getChecked;return React.createElement("div",Object.assign({},v,{ref:b,className:cnCheckboxGroup({direction:n,size:p,view:r},[t])}),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),label:h(a),size:p,view:r,name:l,ref:u(a),disabled:void 0!==s&&s||(null===i||void 0===i?void 0:i(a)),checked:y(a),onChange:function(b){var c=b.e;return x(a)(c)},className:cnCheckboxGroup("Item",[e])},f))}))};export var CheckboxGroup=forwardRef(CheckboxGroupRender);export*from"./types";
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":"gSAAA,4BAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,cAAT,iDACA,OAASC,EAAT,uBACA,OAASC,QAAT,4BACA,OAASC,kBAAT,gBACA,OAEEC,6BAFF,CAGEC,wBAHF,CAIEC,wBAJF,eAQA,MAAO,IAAMC,gBAAe,CAAGN,EAAE,CAAC,eAAD,CAA1B,CAEP,GAAMO,oBAAmB,CAAG,SAC1BC,CAD0B,CAE1BC,CAF0B,CAGvB,OAiBCP,kBAAkB,CAACM,CAAD,CAjBnB,KAEDE,KAFC,CAEDA,CAFC,YAEO,IAFP,GAGDC,CAHC,GAGDA,KAHC,CAIDC,CAJC,GAIDA,UAJC,CAKDC,CALC,GAKDA,YALC,CAMDC,CANC,GAMDA,eANC,CAODC,CAPC,GAODA,iBAPC,CAQDC,CARC,GAQDA,QARC,CASDC,CATC,GASDA,IATC,KAUDC,SAVC,CAUDA,CAV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,eAAGO,EAAH,GAAGA,CAAH,OAAWJ,EAAW,CAACH,CAAD,CAAX,CAAkBO,CAAlB,CAAX,CATZ,CAUE,SAAS,CAAE3B,eAAe,CAAC,MAAD,CAAS,CAACgB,CAAD,CAAT,CAV5B,EAWMU,CAXN,EAcH,CAjBA,CALH,CAyBH,CAvDD,CAyDA,MAAO,IAAME,cAAa,CAAGpC,UAAU,CACrCS,mBADqC,CAAhC,CAIP"}
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,eANC,CAODC,CAPC,GAODA,iBAPC,CAQDC,CARC,GAQDA,QARC,CASDC,CATC,GASDA,IATC,KAUDC,KAVC,CAUDA,CAVC,YAUOhB,yBAVP,OAWDiB,SAXC,CAWDA,CAXC,YAWWhB,6BAXX,OAYDiB,IAZC,CAYDA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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 '../../utils/types/PropsWithHTMLAttributes';
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 checkboxGroupDirections: readonly ["column", "row"];
12
- export declare type CheckboxGroupDirection = typeof checkboxGroupDirections[number];
13
- export declare const checkboxGroupDefaultDirection: CheckboxGroupDirection;
14
- export declare const checkboxGroupSizes: readonly ["m", "xs", "s", "l"];
15
- export declare type CheckboxGroupPropSize = typeof checkboxGroupSizes[number];
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 checkboxGroupViews: readonly ["primary", "ghost"];
18
- export declare type CheckboxGroupPropView = typeof checkboxGroupViews[number];
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?: CheckboxGroupDirection;
41
+ direction?: CheckboxGroupPropDirection;
42
+ align?: CheckboxGroupPropAlign;
39
43
  size?: CheckboxGroupPropSize;
40
44
  view?: CheckboxGroupPropView;
41
45
  disabled?: boolean;
@@ -1,2 +1,2 @@
1
- export var checkboxGroupDirections=["column","row"];export var checkboxGroupDefaultDirection=checkboxGroupDirections[0];export var checkboxGroupSizes=["m","xs","s","l"];export var checkboxGroupDefaultSize=checkboxGroupSizes[0];export var checkboxGroupViews=["primary","ghost"];export var checkboxGroupDefaultView=checkboxGroupViews[0];
1
+ export var checkboxGroupPropDirections=["column","row"];export var checkboxGroupDefaultDirection=checkboxGroupPropDirections[0];export var checkboxGroupPropSizes=["m","xs","s","l"];export var checkboxGroupDefaultSize=checkboxGroupPropSizes[0];export var checkboxGroupPropViews=["primary","ghost"];export var checkboxGroupDefaultView=checkboxGroupPropViews[0];export var checkboxGroupPropAlign=["center","top"];export var checkboxGroupDefaultAlign=checkboxGroupPropAlign[0];
2
2
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["checkboxGroupDirections","checkboxGroupDefaultDirection","checkboxGroupSizes","checkboxGroupDefaultSize","checkboxGroupViews","checkboxGroupDefaultView"],"sources":["../../../../../src/components/CheckboxGroup/types.ts"],"sourcesContent":["import React from 'react';\n\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\n\ntype CheckboxGroupPropAttributes = Omit<\n JSX.IntrinsicElements['label'],\n 'ref' | 'onChange' | 'onFocus' | 'children' | 'onBlur'\n>;\n\nexport type CheckboxGroupDefaultItem = {\n key?: string | number;\n label: string;\n disabled?: boolean;\n attributes?: CheckboxGroupPropAttributes;\n ref?: React.RefObject<HTMLLabelElement>;\n};\n\nexport const checkboxGroupDirections = ['column', 'row'] as const;\nexport type CheckboxGroupDirection = typeof checkboxGroupDirections[number];\nexport const checkboxGroupDefaultDirection: CheckboxGroupDirection =\n checkboxGroupDirections[0];\n\nexport const checkboxGroupSizes = ['m', 'xs', 's', 'l'] as const;\nexport type CheckboxGroupPropSize = typeof checkboxGroupSizes[number];\nexport const checkboxGroupDefaultSize: CheckboxGroupPropSize =\n checkboxGroupSizes[0];\n\nexport const checkboxGroupViews = ['primary', 'ghost'] as const;\nexport type CheckboxGroupPropView = typeof checkboxGroupViews[number];\nexport const checkboxGroupDefaultView: CheckboxGroupPropView =\n checkboxGroupViews[0];\n\nexport type CheckboxGroupPropGetItemKey<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\nexport type CheckboxGroupPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type CheckboxGroupPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\nexport type CheckboxGroupPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => CheckboxGroupPropAttributes | undefined;\nexport type CheckboxGroupPropGetItemRef<ITEM> = (\n item: ITEM,\n) => React.RefObject<HTMLLabelElement> | undefined;\n\nexport type CheckboxGroupProps<ITEM = CheckboxGroupDefaultItem> =\n PropsWithHTMLAttributesAndRef<\n {\n value?: ITEM[] | null;\n items: ITEM[];\n getItemKey?: CheckboxGroupPropGetItemKey<ITEM>;\n getItemLabel?: CheckboxGroupPropGetItemLabel<ITEM>;\n getItemDisabled?: CheckboxGroupPropGetItemDisabled<ITEM>;\n getItemAttributes?: CheckboxGroupPropGetItemAttributes<ITEM>;\n getItemRef?: CheckboxGroupPropGetItemRef<ITEM>;\n onChange: (props: {\n e: React.ChangeEvent<HTMLInputElement>;\n value: ITEM[] | null;\n }) => void;\n name?: string;\n direction?: CheckboxGroupDirection;\n size?: CheckboxGroupPropSize;\n view?: CheckboxGroupPropView;\n disabled?: boolean;\n className?: string;\n },\n HTMLDivElement\n > &\n (ITEM extends { label: CheckboxGroupDefaultItem['label'] }\n ? {}\n : {\n getItemLabel: CheckboxGroupPropGetItemLabel<ITEM>;\n });\n\nexport type CheckboxGroupComponent = <ITEM = CheckboxGroupDefaultItem>(\n props: CheckboxGroupProps<ITEM>,\n) => React.ReactElement | null;\n"],"mappings":"AAiBA,MAAO,IAAMA,wBAAuB,CAAG,CAAC,QAAD,CAAW,KAAX,CAAhC,CAEP,MAAO,IAAMC,8BAAqD,CAChED,uBAAuB,CAAC,CAAD,CADlB,CAGP,MAAO,IAAME,mBAAkB,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAA3B,CAEP,MAAO,IAAMC,yBAA+C,CAC1DD,kBAAkB,CAAC,CAAD,CADb,CAGP,MAAO,IAAME,mBAAkB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAA3B,CAEP,MAAO,IAAMC,yBAA+C,CAC1DD,kBAAkB,CAAC,CAAD,CADb"}
1
+ {"version":3,"file":"types.js","names":["checkboxGroupPropDirections","checkboxGroupDefaultDirection","checkboxGroupPropSizes","checkboxGroupDefaultSize","checkboxGroupPropViews","checkboxGroupDefaultView","checkboxGroupPropAlign","checkboxGroupDefaultAlign"],"sources":["../../../../../src/components/CheckboxGroup/types.ts"],"sourcesContent":["import React from 'react';\n\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\ntype CheckboxGroupPropAttributes = Omit<\n JSX.IntrinsicElements['label'],\n 'ref' | 'onChange' | 'onFocus' | 'children' | 'onBlur'\n>;\n\nexport type CheckboxGroupDefaultItem = {\n key?: string | number;\n label: string;\n disabled?: boolean;\n attributes?: CheckboxGroupPropAttributes;\n ref?: React.RefObject<HTMLLabelElement>;\n};\n\nexport const checkboxGroupPropDirections = ['column', 'row'] as const;\nexport type CheckboxGroupPropDirection =\n typeof checkboxGroupPropDirections[number];\nexport const checkboxGroupDefaultDirection: CheckboxGroupPropDirection =\n checkboxGroupPropDirections[0];\n\nexport const checkboxGroupPropSizes = ['m', 'xs', 's', 'l'] as const;\nexport type CheckboxGroupPropSize = typeof checkboxGroupPropSizes[number];\nexport const checkboxGroupDefaultSize: CheckboxGroupPropSize =\n checkboxGroupPropSizes[0];\n\nexport const checkboxGroupPropViews = ['primary', 'ghost'] as const;\nexport type CheckboxGroupPropView = typeof checkboxGroupPropViews[number];\nexport const checkboxGroupDefaultView: CheckboxGroupPropView =\n checkboxGroupPropViews[0];\n\nexport const checkboxGroupPropAlign = ['center', 'top'] as const;\nexport type CheckboxGroupPropAlign = typeof checkboxGroupPropAlign[number];\nexport const checkboxGroupDefaultAlign: CheckboxGroupPropAlign =\n checkboxGroupPropAlign[0];\n\nexport type CheckboxGroupPropGetItemKey<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\nexport type CheckboxGroupPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type CheckboxGroupPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\nexport type CheckboxGroupPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => CheckboxGroupPropAttributes | undefined;\nexport type CheckboxGroupPropGetItemRef<ITEM> = (\n item: ITEM,\n) => React.RefObject<HTMLLabelElement> | undefined;\n\nexport type CheckboxGroupProps<ITEM = CheckboxGroupDefaultItem> =\n PropsWithHTMLAttributesAndRef<\n {\n value?: ITEM[] | null;\n items: ITEM[];\n getItemKey?: CheckboxGroupPropGetItemKey<ITEM>;\n getItemLabel?: CheckboxGroupPropGetItemLabel<ITEM>;\n getItemDisabled?: CheckboxGroupPropGetItemDisabled<ITEM>;\n getItemAttributes?: CheckboxGroupPropGetItemAttributes<ITEM>;\n getItemRef?: CheckboxGroupPropGetItemRef<ITEM>;\n onChange: (props: {\n e: React.ChangeEvent<HTMLInputElement>;\n value: ITEM[] | null;\n }) => void;\n name?: string;\n direction?: CheckboxGroupPropDirection;\n align?: CheckboxGroupPropAlign;\n size?: CheckboxGroupPropSize;\n view?: CheckboxGroupPropView;\n disabled?: boolean;\n className?: string;\n },\n HTMLDivElement\n > &\n (ITEM extends { label: CheckboxGroupDefaultItem['label'] }\n ? {}\n : {\n getItemLabel: CheckboxGroupPropGetItemLabel<ITEM>;\n });\n\nexport type CheckboxGroupComponent = <ITEM = CheckboxGroupDefaultItem>(\n props: CheckboxGroupProps<ITEM>,\n) => React.ReactElement | null;\n"],"mappings":"AAiBA,MAAO,IAAMA,4BAA2B,CAAG,CAAC,QAAD,CAAW,KAAX,CAApC,CAGP,MAAO,IAAMC,8BAAyD,CACpED,2BAA2B,CAAC,CAAD,CADtB,CAGP,MAAO,IAAME,uBAAsB,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAA/B,CAEP,MAAO,IAAMC,yBAA+C,CAC1DD,sBAAsB,CAAC,CAAD,CADjB,CAGP,MAAO,IAAME,uBAAsB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAA/B,CAEP,MAAO,IAAMC,yBAA+C,CAC1DD,sBAAsB,CAAC,CAAD,CADjB,CAGP,MAAO,IAAME,uBAAsB,CAAG,CAAC,QAAD,CAAW,KAAX,CAA/B,CAEP,MAAO,IAAMC,0BAAiD,CAC5DD,sBAAsB,CAAC,CAAD,CADjB"}
@@ -18,8 +18,8 @@ export declare const choiceGroupViews: readonly ["primary", "ghost", "secondary"
18
18
  export declare type ChoiceGroupPropView = typeof choiceGroupViews[number];
19
19
  export declare const choiceGroupDefaultView: ChoiceGroupPropView;
20
20
  export declare const choiceGroupWidth: readonly ["default", "full"];
21
- export declare type СhoiceGroupPropWidth = typeof choiceGroupWidth[number];
22
- export declare const choiceGroupWidthDefault: СhoiceGroupPropWidth;
21
+ export declare type ChoiceGroupPropWidth = typeof choiceGroupWidth[number];
22
+ export declare const choiceGroupWidthDefault: ChoiceGroupPropWidth;
23
23
  export declare type ChoiceGroupPropGetItemLabel<ITEM> = (item: ITEM) => string | number;
24
24
  export declare type ChoiceGroupPropGetItemIcon<ITEM> = (item: ITEM) => IconComponent | undefined;
25
25
  export declare type ChoiceGroupPropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;
@@ -34,7 +34,7 @@ export declare type ChoiceGroupProps<ITEM = ChoiceGroupDefaultItem, MULTIPLE ext
34
34
  size?: ChoiceGroupPropSize;
35
35
  form?: ChoiceGroupPropForm;
36
36
  view?: ChoiceGroupPropView;
37
- width?: СhoiceGroupPropWidth;
37
+ width?: ChoiceGroupPropWidth;
38
38
  onlyIcon?: boolean;
39
39
  iconSize?: IconPropSize;
40
40
  items: ITEM[];
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["choiceGroupForms","choiceGroupDefaultForm","choiceGroupSizes","choiceGroupDefaultSize","choiceGroupViews","choiceGroupDefaultView","choiceGroupWidth","choiceGroupWidthDefault"],"sources":["../../../../../src/components/ChoiceGroup/types.ts"],"sourcesContent":["import { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\n\nexport type ChoiceGroupDefaultItem = {\n label: string;\n icon?: IconComponent;\n disabled?: boolean;\n attributes?: Omit<\n JSX.IntrinsicElements['label'],\n 'ref' | 'onChange' | 'children'\n >;\n ref?: React.RefObject<HTMLLabelElement>;\n};\n\nexport const choiceGroupForms = ['default', 'brick', 'round'] as const;\nexport type ChoiceGroupPropForm = typeof choiceGroupForms[number];\nexport const choiceGroupDefaultForm: ChoiceGroupPropForm = 'default';\n\nexport const choiceGroupSizes = ['xs', 's', 'm', 'l'] as const;\nexport type ChoiceGroupPropSize = typeof choiceGroupSizes[number];\nexport const choiceGroupDefaultSize: ChoiceGroupPropSize = 'm';\n\nexport const choiceGroupViews = ['primary', 'ghost', 'secondary'] as const;\nexport type ChoiceGroupPropView = typeof choiceGroupViews[number];\nexport const choiceGroupDefaultView: ChoiceGroupPropView = 'primary';\n\nexport const choiceGroupWidth = ['default', 'full'] as const;\nexport type СhoiceGroupPropWidth = typeof choiceGroupWidth[number];\nexport const choiceGroupWidthDefault: СhoiceGroupPropWidth =\n choiceGroupWidth[0];\n\nexport type ChoiceGroupPropGetItemLabel<ITEM> = (item: ITEM) => string | number;\nexport type ChoiceGroupPropGetItemIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\nexport type ChoiceGroupPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\nexport type ChoiceGroupPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) =>\n | Omit<JSX.IntrinsicElements['label'], 'ref' | 'onChange' | 'children'>\n | undefined;\nexport type ChoiceGroupPropGetItemRef<ITEM> = (\n item: ITEM,\n) => React.RefObject<HTMLLabelElement> | undefined;\n\nexport type ChoiceGroupPropValue<ITEM, MULTIPLE extends boolean> =\n | (MULTIPLE extends true ? ITEM[] : ITEM)\n | null;\n\nexport type ChoiceGroupPropOnChange<ITEM, MULTIPLE extends boolean> = (props: {\n e: React.ChangeEvent<HTMLInputElement>;\n value: MULTIPLE extends true ? ITEM[] | null : ITEM;\n}) => void;\n\nexport type ChoiceGroupProps<\n ITEM = ChoiceGroupDefaultItem,\n MULTIPLE extends boolean = false,\n> = PropsWithHTMLAttributesAndRef<\n {\n size?: ChoiceGroupPropSize;\n form?: ChoiceGroupPropForm;\n view?: ChoiceGroupPropView;\n width?: СhoiceGroupPropWidth;\n onlyIcon?: boolean;\n iconSize?: IconPropSize;\n items: ITEM[];\n getItemLabel?: ChoiceGroupPropGetItemLabel<ITEM>;\n getItemIcon?: ChoiceGroupPropGetItemIcon<ITEM>;\n getItemAttributes?: ChoiceGroupPropGetItemAttributes<ITEM>;\n getItemRef?: ChoiceGroupPropGetItemRef<ITEM>;\n name: string;\n disabled?: boolean;\n getItemDisabled?: ChoiceGroupPropGetItemDisabled<ITEM>;\n value?: ChoiceGroupPropValue<ITEM, MULTIPLE>;\n onChange?: ChoiceGroupPropOnChange<ITEM, MULTIPLE>;\n multiple?: MULTIPLE;\n truncate?: boolean;\n children?: never;\n },\n HTMLDivElement\n> &\n (ITEM extends { label: ChoiceGroupDefaultItem['label'] }\n ? {}\n : {\n getItemLabel: ChoiceGroupPropGetItemLabel<ITEM>;\n });\n\nexport type ChoiceGroupItemProps = {\n icon?: IconComponent;\n onlyIcon?: boolean;\n iconSize?: IconPropSize;\n label: string;\n name: string;\n onChange: React.ChangeEventHandler<HTMLInputElement>;\n checked: boolean;\n multiple: boolean;\n disabled?: boolean;\n};\n\nexport type ChoiceGroupComponent = <ITEM, MULTIPLE extends boolean = false>(\n props: ChoiceGroupProps<ITEM, MULTIPLE>,\n) => React.ReactElement | null;\n"],"mappings":"AAgBA,MAAO,IAAMA,iBAAgB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,OAArB,CAAzB,CAEP,MAAO,IAAMC,uBAA2C,CAAG,SAApD,CAEP,MAAO,IAAMC,iBAAgB,CAAG,CAAC,IAAD,CAAO,GAAP,CAAY,GAAZ,CAAiB,GAAjB,CAAzB,CAEP,MAAO,IAAMC,uBAA2C,CAAG,GAApD,CAEP,MAAO,IAAMC,iBAAgB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,WAArB,CAAzB,CAEP,MAAO,IAAMC,uBAA2C,CAAG,SAApD,CAEP,MAAO,IAAMC,iBAAgB,CAAG,CAAC,SAAD,CAAY,MAAZ,CAAzB,CAEP,MAAO,IAAMC,wBAA6C,CACxDD,gBAAgB,CAAC,CAAD,CADX"}
1
+ {"version":3,"file":"types.js","names":["choiceGroupForms","choiceGroupDefaultForm","choiceGroupSizes","choiceGroupDefaultSize","choiceGroupViews","choiceGroupDefaultView","choiceGroupWidth","choiceGroupWidthDefault"],"sources":["../../../../../src/components/ChoiceGroup/types.ts"],"sourcesContent":["import { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\n\nexport type ChoiceGroupDefaultItem = {\n label: string;\n icon?: IconComponent;\n disabled?: boolean;\n attributes?: Omit<\n JSX.IntrinsicElements['label'],\n 'ref' | 'onChange' | 'children'\n >;\n ref?: React.RefObject<HTMLLabelElement>;\n};\n\nexport const choiceGroupForms = ['default', 'brick', 'round'] as const;\nexport type ChoiceGroupPropForm = typeof choiceGroupForms[number];\nexport const choiceGroupDefaultForm: ChoiceGroupPropForm = 'default';\n\nexport const choiceGroupSizes = ['xs', 's', 'm', 'l'] as const;\nexport type ChoiceGroupPropSize = typeof choiceGroupSizes[number];\nexport const choiceGroupDefaultSize: ChoiceGroupPropSize = 'm';\n\nexport const choiceGroupViews = ['primary', 'ghost', 'secondary'] as const;\nexport type ChoiceGroupPropView = typeof choiceGroupViews[number];\nexport const choiceGroupDefaultView: ChoiceGroupPropView = 'primary';\n\nexport const choiceGroupWidth = ['default', 'full'] as const;\nexport type ChoiceGroupPropWidth = typeof choiceGroupWidth[number];\nexport const choiceGroupWidthDefault: ChoiceGroupPropWidth =\n choiceGroupWidth[0];\n\nexport type ChoiceGroupPropGetItemLabel<ITEM> = (item: ITEM) => string | number;\nexport type ChoiceGroupPropGetItemIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\nexport type ChoiceGroupPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\nexport type ChoiceGroupPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) =>\n | Omit<JSX.IntrinsicElements['label'], 'ref' | 'onChange' | 'children'>\n | undefined;\nexport type ChoiceGroupPropGetItemRef<ITEM> = (\n item: ITEM,\n) => React.RefObject<HTMLLabelElement> | undefined;\n\nexport type ChoiceGroupPropValue<ITEM, MULTIPLE extends boolean> =\n | (MULTIPLE extends true ? ITEM[] : ITEM)\n | null;\n\nexport type ChoiceGroupPropOnChange<ITEM, MULTIPLE extends boolean> = (props: {\n e: React.ChangeEvent<HTMLInputElement>;\n value: MULTIPLE extends true ? ITEM[] | null : ITEM;\n}) => void;\n\nexport type ChoiceGroupProps<\n ITEM = ChoiceGroupDefaultItem,\n MULTIPLE extends boolean = false,\n> = PropsWithHTMLAttributesAndRef<\n {\n size?: ChoiceGroupPropSize;\n form?: ChoiceGroupPropForm;\n view?: ChoiceGroupPropView;\n width?: ChoiceGroupPropWidth;\n onlyIcon?: boolean;\n iconSize?: IconPropSize;\n items: ITEM[];\n getItemLabel?: ChoiceGroupPropGetItemLabel<ITEM>;\n getItemIcon?: ChoiceGroupPropGetItemIcon<ITEM>;\n getItemAttributes?: ChoiceGroupPropGetItemAttributes<ITEM>;\n getItemRef?: ChoiceGroupPropGetItemRef<ITEM>;\n name: string;\n disabled?: boolean;\n getItemDisabled?: ChoiceGroupPropGetItemDisabled<ITEM>;\n value?: ChoiceGroupPropValue<ITEM, MULTIPLE>;\n onChange?: ChoiceGroupPropOnChange<ITEM, MULTIPLE>;\n multiple?: MULTIPLE;\n truncate?: boolean;\n children?: never;\n },\n HTMLDivElement\n> &\n (ITEM extends { label: ChoiceGroupDefaultItem['label'] }\n ? {}\n : {\n getItemLabel: ChoiceGroupPropGetItemLabel<ITEM>;\n });\n\nexport type ChoiceGroupItemProps = {\n icon?: IconComponent;\n onlyIcon?: boolean;\n iconSize?: IconPropSize;\n label: string;\n name: string;\n onChange: React.ChangeEventHandler<HTMLInputElement>;\n checked: boolean;\n multiple: boolean;\n disabled?: boolean;\n};\n\nexport type ChoiceGroupComponent = <ITEM, MULTIPLE extends boolean = false>(\n props: ChoiceGroupProps<ITEM, MULTIPLE>,\n) => React.ReactElement | null;\n"],"mappings":"AAgBA,MAAO,IAAMA,iBAAgB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,OAArB,CAAzB,CAEP,MAAO,IAAMC,uBAA2C,CAAG,SAApD,CAEP,MAAO,IAAMC,iBAAgB,CAAG,CAAC,IAAD,CAAO,GAAP,CAAY,GAAZ,CAAiB,GAAjB,CAAzB,CAEP,MAAO,IAAMC,uBAA2C,CAAG,GAApD,CAEP,MAAO,IAAMC,iBAAgB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,WAArB,CAAzB,CAEP,MAAO,IAAMC,uBAA2C,CAAG,SAApD,CAEP,MAAO,IAAMC,iBAAgB,CAAG,CAAC,SAAD,CAAY,MAAZ,CAAzB,CAEP,MAAO,IAAMC,wBAA6C,CACxDD,gBAAgB,CAAC,CAAD,CADX"}
@@ -12,8 +12,8 @@ export declare const choiceGroupViews: readonly ["primary", "ghost", "secondary"
12
12
  export declare type ChoiceGroupPropView = typeof choiceGroupViews[number];
13
13
  export declare const choiceGroupDefaultView: ChoiceGroupPropView;
14
14
  export declare const choiceGroupWidth: readonly ["default", "full"];
15
- export declare type СhoiceGroupPropWidth = typeof choiceGroupWidth[number];
16
- export declare const choiceGroupWidthDefault: СhoiceGroupPropWidth;
15
+ export declare type ChoiceGroupPropWidth = typeof choiceGroupWidth[number];
16
+ export declare const choiceGroupWidthDefault: ChoiceGroupPropWidth;
17
17
  export declare type ChoiceGroupPropGetLabel<ITEM> = (item: ITEM) => string | number;
18
18
  export declare type ChoiceGroupPropGetIcon<ITEM> = (item: ITEM) => IconComponent | undefined;
19
19
  export declare type ChoiceGroupPropValue<ITEM, MULTIPLE extends boolean> = (MULTIPLE extends true ? ITEM[] : ITEM) | null;
@@ -25,7 +25,7 @@ declare type Props<ITEM, MULTIPLE extends boolean = false> = PropsWithHTMLAttrib
25
25
  size?: ChoiceGroupPropSize;
26
26
  form?: ChoiceGroupPropForm;
27
27
  view?: ChoiceGroupPropView;
28
- width?: СhoiceGroupPropWidth;
28
+ width?: ChoiceGroupPropWidth;
29
29
  onlyIcon?: boolean;
30
30
  iconSize?: IconPropSize;
31
31
  items: ITEM[];
@@ -1 +1 @@
1
- {"version":3,"file":"ChoiceGroupDeprecated.js","names":["React","useChoiceGroup","cn","getByMap","ChoiceGroupItem","choiceGroupForms","choiceGroupDefaultForm","choiceGroupSizes","choiceGroupDefaultSize","choiceGroupViews","choiceGroupDefaultView","choiceGroupWidth","choiceGroupWidthDefault","sizeMap","xs","s","m","l","cnChoiceGroup","ChoiceGroup","forwardRef","props","ref","size","form","view","width","onlyIcon","iconSizeProp","iconSize","value","multiple","items","getLabel","onChange","getIcon","name","className","disabled","getDisabled","truncate","otherProps","getKey","callBack","getOnChange","getChecked","map","item","idx","itemChecked","itemDisabled","checked","toString"],"sources":["../../../../../src/components/ChoiceGroupDeprecated/ChoiceGroupDeprecated.tsx"],"sourcesContent":["import './ChoiceGroup.css';\n\nimport { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { useChoiceGroup } from '../../hooks/useChoiceGroup/useChoiceGroup';\nimport { cn } from '../../utils/bem';\nimport { getByMap } from '../../utils/getByMap';\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\nimport { ChoiceGroupItem } from './Item/ChoiceGroup-Item';\n\nexport const choiceGroupForms = ['default', 'brick', 'round'] as const;\nexport type ChoiceGroupPropForm = typeof choiceGroupForms[number];\nexport const choiceGroupDefaultForm: ChoiceGroupPropForm = 'default';\n\nexport const choiceGroupSizes = ['xs', 's', 'm', 'l'] as const;\nexport type ChoiceGroupPropSize = typeof choiceGroupSizes[number];\nexport const choiceGroupDefaultSize: ChoiceGroupPropSize = 'm';\n\nexport const choiceGroupViews = ['primary', 'ghost', 'secondary'] as const;\nexport type ChoiceGroupPropView = typeof choiceGroupViews[number];\nexport const choiceGroupDefaultView: ChoiceGroupPropView = 'primary';\n\nexport const choiceGroupWidth = ['default', 'full'] as const;\nexport type СhoiceGroupPropWidth = typeof choiceGroupWidth[number];\nexport const choiceGroupWidthDefault: СhoiceGroupPropWidth =\n choiceGroupWidth[0];\n\nexport type ChoiceGroupPropGetLabel<ITEM> = (item: ITEM) => string | number;\nexport type ChoiceGroupPropGetIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ChoiceGroupPropValue<ITEM, MULTIPLE extends boolean> =\n | (MULTIPLE extends true ? ITEM[] : ITEM)\n | null;\n\nexport type ChoiceGroupPropOnChange<ITEM, MULTIPLE extends boolean> = (props: {\n e: React.ChangeEvent<HTMLInputElement>;\n value: MULTIPLE extends true ? ITEM[] | null : ITEM;\n}) => void;\n\ntype Props<\n ITEM,\n MULTIPLE extends boolean = false,\n> = PropsWithHTMLAttributesAndRef<\n {\n size?: ChoiceGroupPropSize;\n form?: ChoiceGroupPropForm;\n view?: ChoiceGroupPropView;\n width?: СhoiceGroupPropWidth;\n onlyIcon?: boolean;\n iconSize?: IconPropSize;\n items: ITEM[];\n getLabel: ChoiceGroupPropGetLabel<ITEM>;\n getIcon?: ChoiceGroupPropGetIcon<ITEM>;\n name: string;\n disabled?: boolean;\n getDisabled?: (item: ITEM) => boolean | undefined;\n value?: ChoiceGroupPropValue<ITEM, MULTIPLE>;\n onChange?: ChoiceGroupPropOnChange<ITEM, MULTIPLE>;\n multiple?: MULTIPLE;\n truncate?: boolean;\n children?: never;\n },\n HTMLDivElement\n>;\n\ntype ChoiceGroupComponent = <ITEM, MULTIPLE extends boolean = false>(\n props: Props<ITEM, MULTIPLE>,\n) => React.ReactElement | null;\n\nconst sizeMap: Record<ChoiceGroupPropSize, IconPropSize> = {\n xs: 'xs',\n s: 'xs',\n m: 's',\n l: 'm',\n};\n\nexport const cnChoiceGroup = cn('ChoiceGroup');\n\nexport const ChoiceGroup: ChoiceGroupComponent = React.forwardRef(\n (props, ref) => {\n const {\n size = choiceGroupDefaultSize,\n form = choiceGroupDefaultForm,\n view = choiceGroupDefaultView,\n width = choiceGroupWidthDefault,\n onlyIcon,\n iconSize: iconSizeProp,\n value = null,\n multiple = false,\n items,\n getLabel,\n onChange,\n getIcon,\n name,\n className,\n disabled = false,\n getDisabled,\n truncate,\n ...otherProps\n } = props;\n\n type Item = typeof items[number];\n\n const { getOnChange, getChecked } = useChoiceGroup<\n Item,\n React.ChangeEvent<HTMLInputElement>\n >({\n value: value as Item,\n getKey: getLabel,\n callBack: onChange as ChoiceGroupPropOnChange<Item, false>,\n multiple: multiple as false,\n // привел к типам из-за того что\n // TS не понимает что параметры для не Multiple и Multiple не могут прийти одновременно\n });\n\n const iconSize = getByMap(sizeMap, size, iconSizeProp);\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnChoiceGroup(\n { size, form, view, width, onlyIcon, disabled, truncate },\n [className],\n )}\n >\n {items.map((item, idx) => {\n const itemChecked = getChecked(item);\n const itemDisabled = !!getDisabled && getDisabled(item);\n return (\n <React.Fragment key={getLabel(item)}>\n {idx > 0 && (\n <div\n className={cnChoiceGroup('Divider', {\n checked: itemChecked,\n disabled: itemDisabled,\n })}\n />\n )}\n <ChoiceGroupItem\n onChange={getOnChange(item)}\n checked={itemChecked}\n label={getLabel(item).toString()}\n icon={getIcon && getIcon(item)}\n iconSize={iconSize}\n multiple={multiple}\n onlyIcon={onlyIcon}\n name={name}\n disabled={disabled || itemDisabled}\n />\n </React.Fragment>\n );\n })}\n </div>\n );\n },\n);\n"],"mappings":"0QAAA,0BAGA,MAAOA,MAAP,KAAkB,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CAGxB,MACE,qBAAC,KAAD,CAAO,QAAP,EAAgB,GAAG,CAAEd,CAAQ,CAACc,CAAD,CAA7B,EACS,CAAN,CAAAC,CAAG,EACF,2BACE,SAAS,CAAE9B,aAAa,CAAC,SAAD,CAAY,CAClCiC,OAAO,CAAEF,CADyB,CAElCX,QAAQ,CAAEY,CAFwB,CAAZ,CAD1B,EAFJ,CASE,oBAAC,eAAD,EACE,QAAQ,CAAEN,CAAW,CAACG,CAAD,CADvB,CAEE,OAAO,CAAEE,CAFX,CAGE,KAAK,CAAEhB,CAAQ,CAACc,CAAD,CAAR,CAAeK,QAAf,EAHT,CAIE,IAAI,CAAEjB,CAAO,EAAIA,CAAO,CAACY,CAAD,CAJ1B,CAKE,QAAQ,CAAElB,CALZ,CAME,QAAQ,CAAEE,CANZ,CAOE,QAAQ,CAAEJ,CAPZ,CAQE,IAAI,CAAES,CARR,CASE,QAAQ,CAAEE,CAAQ,EAAIY,CATxB,EATF,CAsBH,CA1BA,CARH,CAqCH,CA7E8C,CAA1C"}
1
+ {"version":3,"file":"ChoiceGroupDeprecated.js","names":["React","useChoiceGroup","cn","getByMap","ChoiceGroupItem","choiceGroupForms","choiceGroupDefaultForm","choiceGroupSizes","choiceGroupDefaultSize","choiceGroupViews","choiceGroupDefaultView","choiceGroupWidth","choiceGroupWidthDefault","sizeMap","xs","s","m","l","cnChoiceGroup","ChoiceGroup","forwardRef","props","ref","size","form","view","width","onlyIcon","iconSizeProp","iconSize","value","multiple","items","getLabel","onChange","getIcon","name","className","disabled","getDisabled","truncate","otherProps","getKey","callBack","getOnChange","getChecked","map","item","idx","itemChecked","itemDisabled","checked","toString"],"sources":["../../../../../src/components/ChoiceGroupDeprecated/ChoiceGroupDeprecated.tsx"],"sourcesContent":["import './ChoiceGroup.css';\n\nimport { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { useChoiceGroup } from '../../hooks/useChoiceGroup/useChoiceGroup';\nimport { cn } from '../../utils/bem';\nimport { getByMap } from '../../utils/getByMap';\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\nimport { ChoiceGroupItem } from './Item/ChoiceGroup-Item';\n\nexport const choiceGroupForms = ['default', 'brick', 'round'] as const;\nexport type ChoiceGroupPropForm = typeof choiceGroupForms[number];\nexport const choiceGroupDefaultForm: ChoiceGroupPropForm = 'default';\n\nexport const choiceGroupSizes = ['xs', 's', 'm', 'l'] as const;\nexport type ChoiceGroupPropSize = typeof choiceGroupSizes[number];\nexport const choiceGroupDefaultSize: ChoiceGroupPropSize = 'm';\n\nexport const choiceGroupViews = ['primary', 'ghost', 'secondary'] as const;\nexport type ChoiceGroupPropView = typeof choiceGroupViews[number];\nexport const choiceGroupDefaultView: ChoiceGroupPropView = 'primary';\n\nexport const choiceGroupWidth = ['default', 'full'] as const;\nexport type ChoiceGroupPropWidth = typeof choiceGroupWidth[number];\nexport const choiceGroupWidthDefault: ChoiceGroupPropWidth =\n choiceGroupWidth[0];\n\nexport type ChoiceGroupPropGetLabel<ITEM> = (item: ITEM) => string | number;\nexport type ChoiceGroupPropGetIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ChoiceGroupPropValue<ITEM, MULTIPLE extends boolean> =\n | (MULTIPLE extends true ? ITEM[] : ITEM)\n | null;\n\nexport type ChoiceGroupPropOnChange<ITEM, MULTIPLE extends boolean> = (props: {\n e: React.ChangeEvent<HTMLInputElement>;\n value: MULTIPLE extends true ? ITEM[] | null : ITEM;\n}) => void;\n\ntype Props<\n ITEM,\n MULTIPLE extends boolean = false,\n> = PropsWithHTMLAttributesAndRef<\n {\n size?: ChoiceGroupPropSize;\n form?: ChoiceGroupPropForm;\n view?: ChoiceGroupPropView;\n width?: ChoiceGroupPropWidth;\n onlyIcon?: boolean;\n iconSize?: IconPropSize;\n items: ITEM[];\n getLabel: ChoiceGroupPropGetLabel<ITEM>;\n getIcon?: ChoiceGroupPropGetIcon<ITEM>;\n name: string;\n disabled?: boolean;\n getDisabled?: (item: ITEM) => boolean | undefined;\n value?: ChoiceGroupPropValue<ITEM, MULTIPLE>;\n onChange?: ChoiceGroupPropOnChange<ITEM, MULTIPLE>;\n multiple?: MULTIPLE;\n truncate?: boolean;\n children?: never;\n },\n HTMLDivElement\n>;\n\ntype ChoiceGroupComponent = <ITEM, MULTIPLE extends boolean = false>(\n props: Props<ITEM, MULTIPLE>,\n) => React.ReactElement | null;\n\nconst sizeMap: Record<ChoiceGroupPropSize, IconPropSize> = {\n xs: 'xs',\n s: 'xs',\n m: 's',\n l: 'm',\n};\n\nexport const cnChoiceGroup = cn('ChoiceGroup');\n\nexport const ChoiceGroup: ChoiceGroupComponent = React.forwardRef(\n (props, ref) => {\n const {\n size = choiceGroupDefaultSize,\n form = choiceGroupDefaultForm,\n view = choiceGroupDefaultView,\n width = choiceGroupWidthDefault,\n onlyIcon,\n iconSize: iconSizeProp,\n value = null,\n multiple = false,\n items,\n getLabel,\n onChange,\n getIcon,\n name,\n className,\n disabled = false,\n getDisabled,\n truncate,\n ...otherProps\n } = props;\n\n type Item = typeof items[number];\n\n const { getOnChange, getChecked } = useChoiceGroup<\n Item,\n React.ChangeEvent<HTMLInputElement>\n >({\n value: value as Item,\n getKey: getLabel,\n callBack: onChange as ChoiceGroupPropOnChange<Item, false>,\n multiple: multiple as false,\n // привел к типам из-за того что\n // TS не понимает что параметры для не Multiple и Multiple не могут прийти одновременно\n });\n\n const iconSize = getByMap(sizeMap, size, iconSizeProp);\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnChoiceGroup(\n { size, form, view, width, onlyIcon, disabled, truncate },\n [className],\n )}\n >\n {items.map((item, idx) => {\n const itemChecked = getChecked(item);\n const itemDisabled = !!getDisabled && getDisabled(item);\n return (\n <React.Fragment key={getLabel(item)}>\n {idx > 0 && (\n <div\n className={cnChoiceGroup('Divider', {\n checked: itemChecked,\n disabled: itemDisabled,\n })}\n />\n )}\n <ChoiceGroupItem\n onChange={getOnChange(item)}\n checked={itemChecked}\n label={getLabel(item).toString()}\n icon={getIcon && getIcon(item)}\n iconSize={iconSize}\n multiple={multiple}\n onlyIcon={onlyIcon}\n name={name}\n disabled={disabled || itemDisabled}\n />\n </React.Fragment>\n );\n })}\n </div>\n );\n },\n);\n"],"mappings":"0QAAA,0BAGA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,cAAT,iDACA,OAASC,EAAT,uBACA,OAASC,QAAT,4BAEA,OAASC,eAAT,+BAEA,MAAO,IAAMC,iBAAgB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,OAArB,CAAzB,CAEP,MAAO,IAAMC,uBAA2C,CAAG,SAApD,CAEP,MAAO,IAAMC,iBAAgB,CAAG,CAAC,IAAD,CAAO,GAAP,CAAY,GAAZ,CAAiB,GAAjB,CAAzB,CAEP,MAAO,IAAMC,uBAA2C,CAAG,GAApD,CAEP,MAAO,IAAMC,iBAAgB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,WAArB,CAAzB,CAEP,MAAO,IAAMC,uBAA2C,CAAG,SAApD,CAEP,MAAO,IAAMC,iBAAgB,CAAG,CAAC,SAAD,CAAY,MAAZ,CAAzB,CAEP,MAAO,IAAMC,wBAA6C,CACxDD,gBAAgB,CAAC,CAAD,CADX,CA+CP,GAAME,QAAkD,CAAG,CACzDC,EAAE,CAAE,IADqD,CAEzDC,CAAC,CAAE,IAFsD,CAGzDC,CAAC,CAAE,GAHsD,CAIzDC,CAAC,CAAE,GAJsD,CAA3D,CAOA,MAAO,IAAMC,cAAa,CAAGhB,EAAE,CAAC,aAAD,CAAxB,CAEP,MAAO,IAAMiB,YAAiC,CAAGnB,KAAK,CAACoB,UAAN,CAC/C,SAACC,CAAD,CAAQC,CAAR,CAAgB,OAoBVD,CApBU,CAEZE,IAFY,CAEZA,CAFY,YAELf,sBAFK,KAoBVa,CApBU,CAGZG,IAHY,CAGZA,CAHY,YAGLlB,sBAHK,KAoBVe,CApBU,CAIZI,IAJY,CAIZA,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AEtB,CAACH,CAAD,CAFsB,CAH1B,GAQGL,CAAK,CAACc,GAAN,CAAU,SAACC,CAAD,CAAOC,CAAP,CAAe,IAClBC,EAAW,CAAGJ,CAAU,CAACE,CAAD,CADN,CAElBG,CAAY,CAAG,CAAC,CAACX,CAAF,EAAiBA,CAAW,CAACQ,CAAD,CAFzB,CAGxB,MACE,qBAAC,KAAD,CAAO,QAAP,EAAgB,GAAG,CAAEd,CAAQ,CAACc,CAAD,CAA7B,EACS,CAAN,CAAAC,CAAG,EACF,2BACE,SAAS,CAAE9B,aAAa,CAAC,SAAD,CAAY,CAClCiC,OAAO,CAAEF,CADyB,CAElCX,QAAQ,CAAEY,CAFwB,CAAZ,CAD1B,EAFJ,CASE,oBAAC,eAAD,EACE,QAAQ,CAAEN,CAAW,CAACG,CAAD,CADvB,CAEE,OAAO,CAAEE,CAFX,CAGE,KAAK,CAAEhB,CAAQ,CAACc,CAAD,CAAR,CAAeK,QAAf,EAHT,CAIE,IAAI,CAAEjB,CAAO,EAAIA,CAAO,CAACY,CAAD,CAJ1B,CAKE,QAAQ,CAAElB,CALZ,CAME,QAAQ,CAAEE,CANZ,CAOE,QAAQ,CAAEJ,CAPZ,CAQE,IAAI,CAAES,CARR,CASE,QAAQ,CAAEE,CAAQ,EAAIY,CATxB,EATF,CAsBH,CA1BA,CARH,CAqCH,CA7E8C,CAA1C"}
@@ -1,9 +1,9 @@
1
- import { DateTimePropOnChange, DateTimePropOnChangeRange, DateTimePropValue, HandleSelectDate, СapableRangeType } from './types';
1
+ import { CapableRangeType, DateTimePropOnChange, DateTimePropOnChangeRange, DateTimePropValue, HandleSelectDate } from './types';
2
2
  declare type GetHandleSelectDateProps = {
3
3
  isEqualUnit: (date1: Date, date2: Date) => boolean;
4
- value?: DateTimePropValue<СapableRangeType>;
4
+ value?: DateTimePropValue<CapableRangeType>;
5
5
  onChange?: DateTimePropOnChange;
6
- onChangeRange?: DateTimePropOnChangeRange<СapableRangeType>;
6
+ onChangeRange?: DateTimePropOnChangeRange<CapableRangeType>;
7
7
  minDate?: Date;
8
8
  maxDate?: Date;
9
9
  };
@@ -1 +1 @@
1
- {"version":3,"file":"getHandleSelectDate.js","names":["isDefined","getHandleSelectDate","props","callbackProps","onChange","onChangeRange","currentValue","Array","isArray","value","startDate","endDate","isEqualUnit","e"],"sources":["../../../../../../src/components/DateTime/helpers/getHandleSelectDate.ts"],"sourcesContent":["import { isDefined } from '../../../utils/type-guards';\nimport { DateRange } from '../../../utils/types/Date';\nimport {\n DateTimePropOnChange,\n DateTimePropOnChangeRange,\n DateTimePropValue,\n HandleSelectDate,\n СapableRangeType,\n} from './types';\n\ntype GetHandleSelectDateProps = {\n isEqualUnit: (date1: Date, date2: Date) => boolean;\n value?: DateTimePropValue<СapableRangeType>;\n onChange?: DateTimePropOnChange;\n onChangeRange?: DateTimePropOnChangeRange<СapableRangeType>;\n minDate?: Date;\n maxDate?: Date;\n};\n\nexport function getHandleSelectDate(\n props: GetHandleSelectDateProps,\n): HandleSelectDate {\n return (callbackProps) => {\n if (typeof props.onChange === 'function') {\n props.onChange(callbackProps);\n }\n\n if (typeof props.onChangeRange === 'function') {\n const currentValue: DateRange = (Array.isArray(props.value)\n ? props.value\n : [props.value, undefined]) || [undefined, undefined];\n\n const [startDate, endDate] = currentValue;\n\n if (\n isDefined(startDate) &&\n props.isEqualUnit(startDate, callbackProps.value)\n ) {\n return props.onChangeRange({\n e: callbackProps.e,\n value: [endDate, undefined],\n });\n }\n\n if (\n isDefined(endDate) &&\n props.isEqualUnit(endDate, callbackProps.value)\n ) {\n return props.onChangeRange({\n e: callbackProps.e,\n value: [startDate, undefined],\n });\n }\n\n if (isDefined(startDate)) {\n return props.onChangeRange({\n e: callbackProps.e,\n value:\n startDate > callbackProps.value\n ? [callbackProps.value, startDate]\n : [startDate, callbackProps.value],\n });\n }\n\n if (isDefined(endDate)) {\n return props.onChangeRange({\n e: callbackProps.e,\n value:\n endDate > callbackProps.value\n ? [callbackProps.value, endDate]\n : [endDate, callbackProps.value],\n });\n }\n\n props.onChangeRange({\n e: callbackProps.e,\n value: [callbackProps.value, undefined],\n });\n }\n };\n}\n"],"mappings":"iEAAA,OAASA,SAAT,kCAmBA,MAAO,SAASC,oBAAT,CACLC,CADK,CAEa,CAClB,MAAO,UAACC,CAAD,CAAmB,CAKxB,GAJ8B,UAA1B,QAAOD,EAAK,CAACE,QAIjB,EAHEF,CAAK,CAACE,QAAN,CAAeD,CAAf,CAGF,CAAmC,UAA/B,QAAOD,EAAK,CAACG,aAAjB,CAA+C,IACvCC,EAAuB,CAAG,CAACC,KAAK,CAACC,OAAN,CAAcN,CAAK,CAACO,KAApB,EAC7BP,CAAK,CAACO,KADuB,CAE7B,CAACP,CAAK,CAACO,KAAP,QAF4B,GAEC,eAHY,kBAKhBH,CALgB,IAKtCI,CALsC,MAK3BC,CAL2B,MAO7C,GACEX,SAAS,CAACU,CAAD,CAAT,EACAR,CAAK,CAACU,WAAN,CAAkBF,CAAlB,CAA6BP,CAAa,CAACM,KAA3C,CAFF,CAIE,MAAOP,EAAK,CAACG,aAAN,CAAoB,CACzBQ,CAAC,CAAEV,CAAa,CAACU,CADQ,CAEzBJ,KAAK,CAAE,CAACE,CAAD,QAFkB,CAApB,CAAP,CAMF,GACEX,SAAS,CAACW,CAAD,CAAT,EACAT,CAAK,CAACU,WAAN,CAAkBD,CAAlB,CAA2BR,CAAa,CAACM,KAAzC,CAFF,CAIE,MAAOP,EAAK,CAACG,aAAN,CAAoB,CACzBQ,CAAC,CAAEV,CAAa,CAACU,CADQ,CAEzBJ,KAAK,CAAE,CAACC,CAAD,QAFkB,CAApB,CAAP,CAMF,GAAIV,SAAS,CAACU,CAAD,CAAb,CACE,MAAOR,EAAK,CAACG,aAAN,CAAoB,CACzBQ,CAAC,CAAEV,CAAa,CAACU,CADQ,CAEzBJ,KAAK,CACHC,CAAS,CAAGP,CAAa,CAACM,KAA1B,CACI,CAACN,CAAa,CAACM,KAAf,CAAsBC,CAAtB,CADJ,CAEI,CAACA,CAAD,CAAYP,CAAa,CAACM,KAA1B,CALmB,CAApB,CAAP,CASF,GAAIT,SAAS,CAACW,CAAD,CAAb,CACE,MAAOT,EAAK,CAACG,aAAN,CAAoB,CACzBQ,CAAC,CAAEV,CAAa,CAACU,CADQ,CAEzBJ,KAAK,CACHE,CAAO,CAAGR,CAAa,CAACM,KAAxB,CACI,CAACN,CAAa,CAACM,KAAf,CAAsBE,CAAtB,CADJ,CAEI,CAACA,CAAD,CAAUR,CAAa,CAACM,KAAxB,CALmB,CAApB,CAAP,CASFP,CAAK,CAACG,aAAN,CAAoB,CAClBQ,CAAC,CAAEV,CAAa,CAACU,CADC,CAElBJ,KAAK,CAAE,CAACN,CAAa,CAACM,KAAf,QAFW,CAApB,CAID,CACF,CACF"}
1
+ {"version":3,"file":"getHandleSelectDate.js","names":["isDefined","getHandleSelectDate","props","callbackProps","onChange","onChangeRange","currentValue","Array","isArray","value","startDate","endDate","isEqualUnit","e"],"sources":["../../../../../../src/components/DateTime/helpers/getHandleSelectDate.ts"],"sourcesContent":["import { isDefined } from '../../../utils/type-guards';\nimport { DateRange } from '../../../utils/types/Date';\nimport {\n CapableRangeType,\n DateTimePropOnChange,\n DateTimePropOnChangeRange,\n DateTimePropValue,\n HandleSelectDate,\n} from './types';\n\ntype GetHandleSelectDateProps = {\n isEqualUnit: (date1: Date, date2: Date) => boolean;\n value?: DateTimePropValue<CapableRangeType>;\n onChange?: DateTimePropOnChange;\n onChangeRange?: DateTimePropOnChangeRange<CapableRangeType>;\n minDate?: Date;\n maxDate?: Date;\n};\n\nexport function getHandleSelectDate(\n props: GetHandleSelectDateProps,\n): HandleSelectDate {\n return (callbackProps) => {\n if (typeof props.onChange === 'function') {\n props.onChange(callbackProps);\n }\n\n if (typeof props.onChangeRange === 'function') {\n const currentValue: DateRange = (Array.isArray(props.value)\n ? props.value\n : [props.value, undefined]) || [undefined, undefined];\n\n const [startDate, endDate] = currentValue;\n\n if (\n isDefined(startDate) &&\n props.isEqualUnit(startDate, callbackProps.value)\n ) {\n return props.onChangeRange({\n e: callbackProps.e,\n value: [endDate, undefined],\n });\n }\n\n if (\n isDefined(endDate) &&\n props.isEqualUnit(endDate, callbackProps.value)\n ) {\n return props.onChangeRange({\n e: callbackProps.e,\n value: [startDate, undefined],\n });\n }\n\n if (isDefined(startDate)) {\n return props.onChangeRange({\n e: callbackProps.e,\n value:\n startDate > callbackProps.value\n ? [callbackProps.value, startDate]\n : [startDate, callbackProps.value],\n });\n }\n\n if (isDefined(endDate)) {\n return props.onChangeRange({\n e: callbackProps.e,\n value:\n endDate > callbackProps.value\n ? [callbackProps.value, endDate]\n : [endDate, callbackProps.value],\n });\n }\n\n props.onChangeRange({\n e: callbackProps.e,\n value: [callbackProps.value, undefined],\n });\n }\n };\n}\n"],"mappings":"iEAAA,OAASA,SAAT,kCAmBA,MAAO,SAASC,oBAAT,CACLC,CADK,CAEa,CAClB,MAAO,UAACC,CAAD,CAAmB,CAKxB,GAJ8B,UAA1B,QAAOD,EAAK,CAACE,QAIjB,EAHEF,CAAK,CAACE,QAAN,CAAeD,CAAf,CAGF,CAAmC,UAA/B,QAAOD,EAAK,CAACG,aAAjB,CAA+C,IACvCC,EAAuB,CAAG,CAACC,KAAK,CAACC,OAAN,CAAcN,CAAK,CAACO,KAApB,EAC7BP,CAAK,CAACO,KADuB,CAE7B,CAACP,CAAK,CAACO,KAAP,QAF4B,GAEC,eAHY,kBAKhBH,CALgB,IAKtCI,CALsC,MAK3BC,CAL2B,MAO7C,GACEX,SAAS,CAACU,CAAD,CAAT,EACAR,CAAK,CAACU,WAAN,CAAkBF,CAAlB,CAA6BP,CAAa,CAACM,KAA3C,CAFF,CAIE,MAAOP,EAAK,CAACG,aAAN,CAAoB,CACzBQ,CAAC,CAAEV,CAAa,CAACU,CADQ,CAEzBJ,KAAK,CAAE,CAACE,CAAD,QAFkB,CAApB,CAAP,CAMF,GACEX,SAAS,CAACW,CAAD,CAAT,EACAT,CAAK,CAACU,WAAN,CAAkBD,CAAlB,CAA2BR,CAAa,CAACM,KAAzC,CAFF,CAIE,MAAOP,EAAK,CAACG,aAAN,CAAoB,CACzBQ,CAAC,CAAEV,CAAa,CAACU,CADQ,CAEzBJ,KAAK,CAAE,CAACC,CAAD,QAFkB,CAApB,CAAP,CAMF,GAAIV,SAAS,CAACU,CAAD,CAAb,CACE,MAAOR,EAAK,CAACG,aAAN,CAAoB,CACzBQ,CAAC,CAAEV,CAAa,CAACU,CADQ,CAEzBJ,KAAK,CACHC,CAAS,CAAGP,CAAa,CAACM,KAA1B,CACI,CAACN,CAAa,CAACM,KAAf,CAAsBC,CAAtB,CADJ,CAEI,CAACA,CAAD,CAAYP,CAAa,CAACM,KAA1B,CALmB,CAApB,CAAP,CASF,GAAIT,SAAS,CAACW,CAAD,CAAb,CACE,MAAOT,EAAK,CAACG,aAAN,CAAoB,CACzBQ,CAAC,CAAEV,CAAa,CAACU,CADQ,CAEzBJ,KAAK,CACHE,CAAO,CAAGR,CAAa,CAACM,KAAxB,CACI,CAACN,CAAa,CAACM,KAAf,CAAsBE,CAAtB,CADJ,CAEI,CAACA,CAAD,CAAUR,CAAa,CAACM,KAAxB,CALmB,CAApB,CAAP,CASFP,CAAK,CAACG,aAAN,CAAoB,CAClBQ,CAAC,CAAEV,CAAa,CAACU,CADC,CAElBJ,KAAK,CAAE,CAACN,CAAa,CAACM,KAAf,QAFW,CAApB,CAID,CACF,CACF"}
@@ -8,13 +8,13 @@ export declare const dateTimePropType: readonly ["date", "month", "year", "time"
8
8
  export declare type DateTimePropType = typeof dateTimePropType[number];
9
9
  export declare const dateTimePropTypeDefault: "date";
10
10
  export declare type DateTimePropDisableDates = Array<Date | [Date, Date]>;
11
- export declare type СapableRangeType = 'date' | 'month' | 'year' | 'date-time';
12
- export declare type DateTimePropValue<TYPE> = TYPE extends СapableRangeType ? Date | DateRange : Date;
11
+ export declare type CapableRangeType = 'date' | 'month' | 'year' | 'date-time';
12
+ export declare type DateTimePropValue<TYPE> = TYPE extends CapableRangeType ? Date | DateRange : Date;
13
13
  export declare type DateTimePropOnChange = (props: {
14
14
  value: Date;
15
15
  e: React.MouseEvent<HTMLButtonElement>;
16
16
  }) => void;
17
- export declare type DateTimePropOnChangeRange<TYPE> = TYPE extends СapableRangeType ? (props: {
17
+ export declare type DateTimePropOnChangeRange<TYPE> = TYPE extends CapableRangeType ? (props: {
18
18
  value: DateRange;
19
19
  e: React.MouseEvent<HTMLButtonElement>;
20
20
  }) => void : never;
@@ -38,7 +38,7 @@ export declare type DateTimeProps<TYPE extends DateTimePropType = 'date'> = Prop
38
38
  minDate?: Date;
39
39
  maxDate?: Date;
40
40
  events?: Date[];
41
- view?: TYPE extends СapableRangeType ? DateTimePropView : 'classic';
41
+ view?: TYPE extends CapableRangeType ? DateTimePropView : 'classic';
42
42
  locale?: DateTimePropLocale;
43
43
  children?: never;
44
44
  disableDates?: DateTimePropDisableDates;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["dateTimePropView","dateTimePropViewDefault","dateTimePropType","dateTimePropTypeDefault","moveTypes"],"sources":["../../../../../../src/components/DateTime/helpers/types.ts"],"sourcesContent":["import { DateRange } from '../../../utils/types/Date';\nimport { PropsWithHTMLAttributesAndRef } from '../../../utils/types/PropsWithHTMLAttributes';\n\nexport const dateTimePropView = ['classic', 'book', 'slider'] as const;\nexport type DateTimePropView = typeof dateTimePropView[number];\nexport const dateTimePropViewDefault = dateTimePropView[0];\n\nexport const dateTimePropType = [\n 'date',\n 'month',\n 'year',\n 'time',\n 'date-time',\n] as const;\nexport type DateTimePropType = typeof dateTimePropType[number];\nexport const dateTimePropTypeDefault = dateTimePropType[0];\n\nexport type DateTimePropDisableDates = Array<Date | [Date, Date]>;\n\nexport type СapableRangeType = 'date' | 'month' | 'year' | 'date-time';\n\nexport type DateTimePropValue<TYPE> = TYPE extends СapableRangeType\n ? Date | DateRange\n : Date;\n\nexport type DateTimePropOnChange = (props: {\n value: Date;\n e: React.MouseEvent<HTMLButtonElement>;\n}) => void;\n\nexport type DateTimePropOnChangeRange<TYPE> = TYPE extends СapableRangeType\n ? (props: {\n value: DateRange;\n e: React.MouseEvent<HTMLButtonElement>;\n }) => void\n : never;\n\ntype LocaleWords = {\n words?: {\n hours?: string;\n minutes?: string;\n seconds?: string;\n };\n};\n\nexport type DateTimePropLocale = Locale & LocaleWords;\n\nexport const moveTypes = ['year', 'month', 'day', 'time'] as const;\nexport type MoveType = typeof moveTypes[number];\n\ntype DateTimePropTimeFor<TYPE> = TYPE extends 'date-time'\n ? 'start' | 'end'\n : never;\n\nexport type DateTimeProps<TYPE extends DateTimePropType = 'date'> =\n PropsWithHTMLAttributesAndRef<\n {\n currentVisibleDate?: Date;\n type?: TYPE;\n value?: DateTimePropValue<TYPE>;\n onChange?: DateTimePropOnChange;\n onChangeRange?: DateTimePropOnChangeRange<TYPE>;\n minDate?: Date;\n maxDate?: Date;\n events?: Date[];\n view?: TYPE extends СapableRangeType ? DateTimePropView : 'classic';\n locale?: DateTimePropLocale;\n children?: never;\n disableDates?: DateTimePropDisableDates;\n onChangeCurrentVisibleDate?: (date: Date) => void;\n multiplicitySeconds?: number;\n multiplicityMinutes?: number;\n multiplicityHours?: number;\n onMove?: (type: MoveType) => void;\n timeFor?: DateTimePropTimeFor<TYPE>;\n },\n HTMLDivElement\n >;\n\nexport type DateTimeComponent = <TYPE extends DateTimePropType = 'date'>(\n props: DateTimeProps<TYPE>,\n) => React.ReactElement | null;\n\nexport type DateTimeTypeComponent<TYPE extends DateTimePropType> = (\n props: Omit<DateTimeProps<TYPE>, 'type'>,\n) => React.ReactElement | null;\n\nexport type HandleSelectDate = (props: {\n value: Date;\n e: React.MouseEvent<HTMLButtonElement>;\n}) => void;\n"],"mappings":"AAGA,MAAO,IAAMA,iBAAgB,CAAG,CAAC,SAAD,CAAY,MAAZ,CAAoB,QAApB,CAAzB,CAEP,MAAO,IAAMC,wBAAuB,CAAGD,gBAAgB,CAAC,CAAD,CAAhD,CAEP,MAAO,IAAME,iBAAgB,CAAG,CAC9B,MAD8B,CAE9B,OAF8B,CAG9B,MAH8B,CAI9B,MAJ8B,CAK9B,WAL8B,CAAzB,CAQP,MAAO,IAAMC,wBAAuB,CAAGD,gBAAgB,CAAC,CAAD,CAAhD,CAgCP,MAAO,IAAME,UAAS,CAAG,CAAC,MAAD,CAAS,OAAT,CAAkB,KAAlB,CAAyB,MAAzB,CAAlB"}
1
+ {"version":3,"file":"types.js","names":["dateTimePropView","dateTimePropViewDefault","dateTimePropType","dateTimePropTypeDefault","moveTypes"],"sources":["../../../../../../src/components/DateTime/helpers/types.ts"],"sourcesContent":["import { DateRange } from '../../../utils/types/Date';\nimport { PropsWithHTMLAttributesAndRef } from '../../../utils/types/PropsWithHTMLAttributes';\n\nexport const dateTimePropView = ['classic', 'book', 'slider'] as const;\nexport type DateTimePropView = typeof dateTimePropView[number];\nexport const dateTimePropViewDefault = dateTimePropView[0];\n\nexport const dateTimePropType = [\n 'date',\n 'month',\n 'year',\n 'time',\n 'date-time',\n] as const;\nexport type DateTimePropType = typeof dateTimePropType[number];\nexport const dateTimePropTypeDefault = dateTimePropType[0];\n\nexport type DateTimePropDisableDates = Array<Date | [Date, Date]>;\n\nexport type CapableRangeType = 'date' | 'month' | 'year' | 'date-time';\n\nexport type DateTimePropValue<TYPE> = TYPE extends CapableRangeType\n ? Date | DateRange\n : Date;\n\nexport type DateTimePropOnChange = (props: {\n value: Date;\n e: React.MouseEvent<HTMLButtonElement>;\n}) => void;\n\nexport type DateTimePropOnChangeRange<TYPE> = TYPE extends CapableRangeType\n ? (props: {\n value: DateRange;\n e: React.MouseEvent<HTMLButtonElement>;\n }) => void\n : never;\n\ntype LocaleWords = {\n words?: {\n hours?: string;\n minutes?: string;\n seconds?: string;\n };\n};\n\nexport type DateTimePropLocale = Locale & LocaleWords;\n\nexport const moveTypes = ['year', 'month', 'day', 'time'] as const;\nexport type MoveType = typeof moveTypes[number];\n\ntype DateTimePropTimeFor<TYPE> = TYPE extends 'date-time'\n ? 'start' | 'end'\n : never;\n\nexport type DateTimeProps<TYPE extends DateTimePropType = 'date'> =\n PropsWithHTMLAttributesAndRef<\n {\n currentVisibleDate?: Date;\n type?: TYPE;\n value?: DateTimePropValue<TYPE>;\n onChange?: DateTimePropOnChange;\n onChangeRange?: DateTimePropOnChangeRange<TYPE>;\n minDate?: Date;\n maxDate?: Date;\n events?: Date[];\n view?: TYPE extends CapableRangeType ? DateTimePropView : 'classic';\n locale?: DateTimePropLocale;\n children?: never;\n disableDates?: DateTimePropDisableDates;\n onChangeCurrentVisibleDate?: (date: Date) => void;\n multiplicitySeconds?: number;\n multiplicityMinutes?: number;\n multiplicityHours?: number;\n onMove?: (type: MoveType) => void;\n timeFor?: DateTimePropTimeFor<TYPE>;\n },\n HTMLDivElement\n >;\n\nexport type DateTimeComponent = <TYPE extends DateTimePropType = 'date'>(\n props: DateTimeProps<TYPE>,\n) => React.ReactElement | null;\n\nexport type DateTimeTypeComponent<TYPE extends DateTimePropType> = (\n props: Omit<DateTimeProps<TYPE>, 'type'>,\n) => React.ReactElement | null;\n\nexport type HandleSelectDate = (props: {\n value: Date;\n e: React.MouseEvent<HTMLButtonElement>;\n}) => void;\n"],"mappings":"AAGA,MAAO,IAAMA,iBAAgB,CAAG,CAAC,SAAD,CAAY,MAAZ,CAAoB,QAApB,CAAzB,CAEP,MAAO,IAAMC,wBAAuB,CAAGD,gBAAgB,CAAC,CAAD,CAAhD,CAEP,MAAO,IAAME,iBAAgB,CAAG,CAC9B,MAD8B,CAE9B,OAF8B,CAG9B,MAH8B,CAI9B,MAJ8B,CAK9B,WAL8B,CAAzB,CAQP,MAAO,IAAMC,wBAAuB,CAAGD,gBAAgB,CAAC,CAAD,CAAhD,CAgCP,MAAO,IAAME,UAAS,CAAG,CAAC,MAAD,CAAS,OAAT,CAAkB,KAAlB,CAAyB,MAAzB,CAAlB"}
@@ -1,2 +1,2 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"./DragNDropFieldTooltip.css";import React from"react";import{Text}from"../../Text/Text";import{Tooltip}from"../../TooltipCanary";import{cnMixSpace}from"../../../mixs/MixSpace";import{cn}from"../../../utils/bem";var cnDragNDropFieldTooltip=cn("DragNDropFieldTooltip");export var DragNDropFieldTooltip=function(a){var b=a.anchorRef,c=a.errors,d=React.useState(!1),e=_slicedToArray(d,2),f=e[0],g=e[1];return React.useEffect(function(){g(!1)},[c]),React.createElement(Tooltip,{isOpen:f||0===c.length,anchorRef:b,status:"alert",size:"l",isInteractive:!1,onClickOutside:function onClickOutside(){return g(!0)}},React.createElement(Text,{size:"s",className:cnDragNDropFieldTooltip("Text")},1===c.length?c[0]:React.createElement("ul",{className:cnDragNDropFieldTooltip("List",[cnMixSpace({pL:"xl"})])},c.map(function(a){return React.createElement("li",{key:a},a)}))))};
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"./DragNDropFieldTooltip.css";import React,{useEffect}from"react";import{Text}from"../../Text/Text";import{Tooltip}from"../../TooltipCanary";import{useFlag}from"../../../hooks/useFlag";import{cnMixSpace}from"../../../mixs/MixSpace";import{cn}from"../../../utils/bem";var cnDragNDropFieldTooltip=cn("DragNDropFieldTooltip");export var DragNDropFieldTooltip=function(a){var b=a.anchorRef,c=a.errors,d=useFlag(),e=_slicedToArray(d,2),f=e[0],g=e[1];return useEffect(function(){g[0<c.length?"on":"off"]()},[c]),React.createElement(Tooltip,{isOpen:f,anchorRef:b,status:"alert",size:"l",isInteractive:!1,onClickOutside:g.off},React.createElement(Text,{size:"s",className:cnDragNDropFieldTooltip("Text")},1===c.length?c[0]:React.createElement("ul",{className:cnDragNDropFieldTooltip("List",[cnMixSpace({pL:"xl"})])},c.map(function(a){return React.createElement("li",{key:a},a)}))))};
2
2
  //# sourceMappingURL=DragNDropFieldTooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DragNDropFieldTooltip.js","names":["React","Text","Tooltip","cnMixSpace","cn","cnDragNDropFieldTooltip","DragNDropFieldTooltip","anchorRef","errors","useState","isHidden","setIsHidden","useEffect","length","pL","map","error"],"sources":["../../../../../../src/components/DragNDropField/DragNDropFieldTooltip/DragNDropFieldTooltip.tsx"],"sourcesContent":["import './DragNDropFieldTooltip.css';\n\nimport React from 'react';\n\nimport { Text } from '##/components/Text/Text';\nimport { Tooltip } from '##/components/TooltipCanary';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\n\ntype DragNDropFieldTooltipProps = {\n anchorRef: React.RefObject<HTMLElement>;\n errors: string[];\n};\n\nconst cnDragNDropFieldTooltip = cn('DragNDropFieldTooltip');\n\nexport const DragNDropFieldTooltip: React.FC<DragNDropFieldTooltipProps> = ({\n anchorRef,\n errors,\n}) => {\n const [isHidden, setIsHidden] = React.useState(false);\n\n React.useEffect(() => {\n setIsHidden(false);\n }, [errors]);\n\n return (\n <Tooltip\n isOpen={isHidden || errors.length === 0}\n anchorRef={anchorRef}\n status=\"alert\"\n size=\"l\"\n isInteractive={false}\n onClickOutside={() => setIsHidden(true)}\n >\n <Text size=\"s\" className={cnDragNDropFieldTooltip('Text')}>\n {errors.length === 1 ? (\n errors[0]\n ) : (\n <ul\n className={cnDragNDropFieldTooltip('List', [\n cnMixSpace({ pL: 'xl' }),\n ])}\n >\n {errors.map((error) => (\n <li key={error}>{error}</li>\n ))}\n </ul>\n )}\n </Text>\n </Tooltip>\n );\n};\n"],"mappings":"iEAAA,oCAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,IAAT,uBACA,OAASC,OAAT,2BACA,OAASC,UAAT,8BACA,OAASC,EAAT,0BAOA,GAAMC,wBAAuB,CAAGD,EAAE,CAAC,uBAAD,CAAlC,CAEA,MAAO,IAAME,sBAA2D,CAAG,WAGrE,IAFJC,EAEI,GAFJA,SAEI,CADJC,CACI,GADJA,MACI,GAC4BR,KAAK,CAACS,QAAN,IAD5B,uBACGC,CADH,MACaC,CADb,MAOJ,MAJAX,MAAK,CAACY,SAAN,CAAgB,UAAM,CACpBD,CAAW,IACZ,CAFD,CAEG,CAACH,CAAD,CAFH,CAIA,CACE,oBAAC,OAAD,EACE,MAAM,CAAEE,CAAQ,EAAsB,CAAlB,GAAAF,CAAM,CAACK,MAD7B,CAEE,SAAS,CAAEN,CAFb,CAGE,MAAM,CAAC,OAHT,CAIE,IAAI,CAAC,GAJP,CAKE,aAAa,GALf,CAME,cAAc,CAAE,gCAAMI,EAAW,IAAjB,CANlB,EAQE,oBAAC,IAAD,EAAM,IAAI,CAAC,GAAX,CAAe,SAAS,CAAEN,uBAAuB,CAAC,MAAD,CAAjD,EACqB,CAAlB,GAAAG,CAAM,CAACK,MAAP,CACCL,CAAM,CAAC,CAAD,CADP,CAGC,0BACE,SAAS,CAAEH,uBAAuB,CAAC,MAAD,CAAS,CACzCF,UAAU,CAAC,CAAEW,EAAE,CAAE,IAAN,CAAD,CAD+B,CAAT,CADpC,EAKGN,CAAM,CAACO,GAAP,CAAW,SAACC,CAAD,QACV,2BAAI,GAAG,CAAEA,CAAT,EAAiBA,CAAjB,CADU,CAAX,CALH,CAJJ,CARF,CAyBH,CApCM"}
1
+ {"version":3,"file":"DragNDropFieldTooltip.js","names":["React","useEffect","Text","Tooltip","useFlag","cnMixSpace","cn","cnDragNDropFieldTooltip","DragNDropFieldTooltip","anchorRef","errors","isHidden","setIsOpen","length","off","pL","map","error"],"sources":["../../../../../../src/components/DragNDropField/DragNDropFieldTooltip/DragNDropFieldTooltip.tsx"],"sourcesContent":["import './DragNDropFieldTooltip.css';\n\nimport React, { useEffect } from 'react';\n\nimport { Text } from '##/components/Text/Text';\nimport { Tooltip } from '##/components/TooltipCanary';\nimport { useFlag } from '##/hooks/useFlag';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\n\ntype DragNDropFieldTooltipProps = {\n anchorRef: React.RefObject<HTMLElement>;\n errors: string[];\n};\n\nconst cnDragNDropFieldTooltip = cn('DragNDropFieldTooltip');\n\nexport const DragNDropFieldTooltip: React.FC<DragNDropFieldTooltipProps> = ({\n anchorRef,\n errors,\n}) => {\n const [isHidden, setIsOpen] = useFlag();\n\n useEffect(() => {\n setIsOpen[errors.length > 0 ? 'on' : 'off']();\n }, [errors]);\n\n return (\n <Tooltip\n isOpen={isHidden}\n anchorRef={anchorRef}\n status=\"alert\"\n size=\"l\"\n isInteractive={false}\n onClickOutside={setIsOpen.off}\n >\n <Text size=\"s\" className={cnDragNDropFieldTooltip('Text')}>\n {errors.length === 1 ? (\n errors[0]\n ) : (\n <ul\n className={cnDragNDropFieldTooltip('List', [\n cnMixSpace({ pL: 'xl' }),\n ])}\n >\n {errors.map((error) => (\n <li key={error}>{error}</li>\n ))}\n </ul>\n )}\n </Text>\n </Tooltip>\n );\n};\n"],"mappings":"iEAAA,oCAEA,MAAOA,MAAP,EAAgBC,SAAhB,KAAiC,OAAjC,CAEA,OAASC,IAAT,uBACA,OAASC,OAAT,2BACA,OAASC,OAAT,8BACA,OAASC,UAAT,8BACA,OAASC,EAAT,0BAOA,GAAMC,wBAAuB,CAAGD,EAAE,CAAC,uBAAD,CAAlC,CAEA,MAAO,IAAME,sBAA2D,CAAG,WAGrE,IAFJC,EAEI,GAFJA,SAEI,CADJC,CACI,GADJA,MACI,GAC0BN,OAAO,EADjC,uBACGO,CADH,MACaC,CADb,MAOJ,MAJAX,UAAS,CAAC,UAAM,CACdW,CAAS,CAAiB,CAAhB,CAAAF,CAAM,CAACG,MAAP,CAAoB,IAApB,CAA2B,KAA5B,CAAT,EACD,CAFQ,CAEN,CAACH,CAAD,CAFM,CAIT,CACE,oBAAC,OAAD,EACE,MAAM,CAAEC,CADV,CAEE,SAAS,CAAEF,CAFb,CAGE,MAAM,CAAC,OAHT,CAIE,IAAI,CAAC,GAJP,CAKE,aAAa,GALf,CAME,cAAc,CAAEG,CAAS,CAACE,GAN5B,EAQE,oBAAC,IAAD,EAAM,IAAI,CAAC,GAAX,CAAe,SAAS,CAAEP,uBAAuB,CAAC,MAAD,CAAjD,EACqB,CAAlB,GAAAG,CAAM,CAACG,MAAP,CACCH,CAAM,CAAC,CAAD,CADP,CAGC,0BACE,SAAS,CAAEH,uBAAuB,CAAC,MAAD,CAAS,CACzCF,UAAU,CAAC,CAAEU,EAAE,CAAE,IAAN,CAAD,CAD+B,CAAT,CADpC,EAKGL,CAAM,CAACM,GAAP,CAAW,SAACC,CAAD,QACV,2BAAI,GAAG,CAAEA,CAAT,EAAiBA,CAAjB,CADU,CAAX,CALH,CAJJ,CARF,CAyBH,CApCM"}
@@ -0,0 +1 @@
1
+ .canary--Pagination{max-width:100%}
@@ -0,0 +1 @@
1
+ .PaginationArrow-Caption_orientation_start{margin-right:var(--pagination-arrow-caption-offset)}.PaginationArrow-Caption_orientation_end{margin-left:var(--pagination-arrow-caption-offset)}.PaginationArrow-Caption_size_xs{--pagination-arrow-caption-offset:calc(var(--space-xs) + var(--space-3xs))}.PaginationArrow-Caption_size_m,.PaginationArrow-Caption_size_s{--pagination-arrow-caption-offset:var(--space-m)}.PaginationArrow-Caption_size_l{--pagination-arrow-caption-offset:var(--space-l)}
@@ -0,0 +1,11 @@
1
+ import './PaginationArrow.css';
2
+ import React from 'react';
3
+ export declare const PaginationArrow: React.ForwardRefExoticComponent<{
4
+ icon?: import("@consta/icons/Icon").IconComponent<"span"> | undefined;
5
+ form?: "default" | "brick" | "round" | undefined;
6
+ size?: "m" | "s" | "xs" | "l" | undefined;
7
+ disabled?: boolean | undefined;
8
+ orientation?: "start" | "end" | undefined;
9
+ label?: string | undefined;
10
+ caption?: string | undefined;
11
+ } & Omit<React.HTMLAttributes<HTMLButtonElement>, "css" | "size" | "caption" | "form" | "label" | "disabled" | "icon" | "orientation"> & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,2 @@
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["size","form","label","caption","icon","orientation","disabled","className","children"];import"./PaginationArrow.css";import React,{forwardRef}from"react";import{Button}from"../../Button";import{Text}from"../../Text";import{cnMixFlex}from"../../../mixs/MixFlex";import{cn}from"../../../utils/bem";import{paginationPropFormDefault,paginationPropSizeDefault}from"../types";var cnPaginationArrow=cn("PaginationArrow");export var PaginationArrow=forwardRef(function(a,b){var c=a.size,d=void 0===c?paginationPropSizeDefault:c,e=a.form,f=void 0===e?paginationPropFormDefault:e,g=a.label,h=a.caption,i=a.icon,j=a.orientation,k=a.disabled,l=a.className,m=a.children,n=_objectWithoutProperties(a,_excluded);return g?React.createElement("div",{className:cnPaginationArrow("Wrapper",[cnMixFlex({flex:"inline-flex",align:"start"===j?"flex-end":"flex-start",direction:"column"})])},React.createElement(Button,Object.assign({size:d,form:f,className:cnPaginationArrow(null,[l]),ref:b,view:"clear",disabled:k,label:g,iconLeft:"start"===j?i:void 0,iconRight:"end"===j?i:void 0},n)),h&&React.createElement(Text,{view:"ghost",size:"xs",lineHeight:"m",className:cnPaginationArrow("Caption",{size:d,orientation:j})},h)):React.createElement(Button,Object.assign({size:d,form:f,disabled:k,onlyIcon:!0,view:"clear",iconLeft:i,className:cnPaginationArrow(null,[l]),ref:b},n))});
2
+ //# sourceMappingURL=PaginationArrow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaginationArrow.js","names":["React","forwardRef","Button","Text","cnMixFlex","cn","paginationPropFormDefault","paginationPropSizeDefault","cnPaginationArrow","PaginationArrow","props","ref","size","form","label","caption","icon","orientation","disabled","className","children","otherProps","flex","align","direction"],"sources":["../../../../../../src/components/PaginationCanary/PaginationArrow/PaginationArrow.tsx"],"sourcesContent":["import './PaginationArrow.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { Button } from '##/components/Button';\nimport { Text } from '##/components/Text';\nimport { cnMixFlex } from '##/mixs/MixFlex';\nimport { cn } from '##/utils/bem';\n\nimport {\n PaginationArrowProps,\n paginationPropFormDefault,\n paginationPropSizeDefault,\n} from '../types';\n\nconst cnPaginationArrow = cn('PaginationArrow');\n\nexport const PaginationArrow = forwardRef<\n HTMLButtonElement,\n PaginationArrowProps\n>((props, ref) => {\n const {\n size = paginationPropSizeDefault,\n form = paginationPropFormDefault,\n label,\n caption,\n icon,\n orientation,\n disabled,\n className,\n children,\n ...otherProps\n } = props;\n\n if (label) {\n return (\n <div\n className={cnPaginationArrow('Wrapper', [\n cnMixFlex({\n flex: 'inline-flex',\n align: orientation === 'start' ? 'flex-end' : 'flex-start',\n direction: 'column',\n }),\n ])}\n >\n <Button\n size={size}\n form={form}\n className={cnPaginationArrow(null, [className])}\n ref={ref}\n view=\"clear\"\n disabled={disabled}\n label={label}\n iconLeft={orientation === 'start' ? icon : undefined}\n iconRight={orientation === 'end' ? icon : undefined}\n {...otherProps}\n />\n {caption && (\n <Text\n view=\"ghost\"\n size=\"xs\"\n lineHeight=\"m\"\n className={cnPaginationArrow('Caption', { size, orientation })}\n >\n {caption}\n </Text>\n )}\n </div>\n );\n }\n\n return (\n <Button\n size={size}\n form={form}\n disabled={disabled}\n onlyIcon\n view=\"clear\"\n iconLeft={icon}\n className={cnPaginationArrow(null, [className])}\n ref={ref}\n {...otherProps}\n />\n );\n});\n"],"mappings":"4LAAA,8BAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,MAAT,oBACA,OAASC,IAAT,kBACA,OAASC,SAAT,6BACA,OAASC,EAAT,0BAEA,OAEEC,yBAFF,CAGEC,yBAHF,gBAMA,GAAMC,kBAAiB,CAAGH,EAAE,CAAC,iBAAD,CAA5B,CAEA,MAAO,IAAMI,gBAAe,CAAGR,UAAU,CAGvC,SAACS,CAAD,CAAQC,CAAR,CAAgB,CAChB,MAWID,CAXJ,CACEE,IADF,CACEA,CADF,YACSL,yBADT,KAWIG,CAXJ,CAEEG,IAFF,CAEEA,CAFF,YAESP,yBAFT,GAGEQ,CAHF,CAWIJ,CAXJ,CAGEI,KAHF,CAIEC,CAJF,CAWIL,CAXJ,CAIEK,OAJF,CAKEC,CALF,CAWIN,CAXJ,CAKEM,IALF,CAMEC,CANF,CAWIP,CAXJ,CAMEO,WANF,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B,CAQE,GAAG,CAAER,CARP,EASMU,CATN,EAYH,CAnEwC,CAAlC"}
@@ -0,0 +1 @@
1
+ export * from './PaginationArrow';
@@ -0,0 +1,2 @@
1
+ export*from"./PaginationArrow";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/components/PaginationCanary/PaginationArrow/index.ts"],"sourcesContent":["export * from './PaginationArrow';\n"],"mappings":"AAAA"}
@@ -0,0 +1,3 @@
1
+ import './PaginationBase.css';
2
+ import { PaginationBaseComponent } from '../types';
3
+ export declare const PaginationBase: PaginationBaseComponent;
@@ -0,0 +1,2 @@
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["items","value","size","form","containerEventListener","onChange","getItemKey","getItemAs","getItemAttributes","getItemClickable","getItemLabel","getItemOnClick","getItemRef","className","arrows","hotKeys","outerMostArrows"];import"./PaginationBase.css";import React,{forwardRef}from"react";import{useRefs}from"../../../hooks/useRefs";import{cnMixFlex}from"../../../mixs/MixFlex";import{cn}from"../../../utils/bem";import{paginationArrowIconsMap,withDefaultGetters}from"../helpers";import{PaginationArrow}from"../PaginationArrow";import{PaginationList}from"../PaginationList";import{paginationPropFormDefault,paginationPropSizeDefault}from"../types";import{usePaginationKeys}from"../usePaginationKeys";var cnPaginationBase=cn("PaginationBase"),PaginationBaseRender=function(a,b){var c=withDefaultGetters(a),d=c.items,e=void 0===d?[]:d,f=c.value,g=c.size,h=void 0===g?paginationPropSizeDefault:g,i=c.form,j=void 0===i?paginationPropFormDefault:i,k=c.containerEventListener,l=c.onChange,m=c.getItemKey,n=c.getItemAs,o=c.getItemAttributes,p=c.getItemClickable,q=c.getItemLabel,r=c.getItemOnClick,s=c.getItemRef,t=c.className,u=c.arrows,v=c.hotKeys,w=c.outerMostArrows,x=_objectWithoutProperties(c,_excluded),y=useRefs(2),z=_slicedToArray(y,2),A=z[0],B=z[1];usePaginationKeys({prevButtonRef:A,nextButtonRef:B,containerEventListener:k,hotKeys:v});var C=function(a,b,c,d){if(!a)return null;var e=a.onClick,f=a.icon,g=void 0===f?paginationArrowIconsMap[b]:f,i=a.label,k=a.disabled,l="first"===b||"previous"===b?"start":"end";return React.createElement(PaginationArrow,{label:i,icon:g,disabled:k,ref:c,size:h,form:j,caption:null===d||void 0===d?void 0:d.label,orientation:l,onClick:e})};return React.createElement("div",Object.assign({className:cnPaginationBase(null,[t,cnMixFlex({wrap:"nowrap",gap:"3xs"})]),ref:b},x),(null===w||void 0===w?void 0:w[0])&&C(w[0],"first",void 0),(null===u||void 0===u?void 0:u[0])&&C(u[0],"previous",A,null===v||void 0===v?void 0:v[0]),React.createElement(PaginationList,{items:e,size:h,form:j,value:f,onItemClick:function onItemClick(a,b){var c=b.e;null===l||void 0===l?void 0:l(a,{e:c})},getItemKey:m,getItemAs:n,getItemAttributes:o,getItemClickable:p,getItemLabel:q,getItemOnClick:r,getItemRef:s}),(null===u||void 0===u?void 0:u[1])&&C(u[1],"next",B,null===v||void 0===v?void 0:v[1]),(null===w||void 0===w?void 0:w[1])&&C(w[1],"last",void 0))};export var PaginationBase=forwardRef(PaginationBaseRender);
2
+ //# sourceMappingURL=PaginationBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaginationBase.js","names":["React","forwardRef","useRefs","cnMixFlex","cn","paginationArrowIconsMap","withDefaultGetters","PaginationArrow","PaginationList","paginationPropFormDefault","paginationPropSizeDefault","usePaginationKeys","cnPaginationBase","PaginationBaseRender","props","ref","items","value","size","form","containerEventListener","onChange","getItemKey","getItemAs","getItemAttributes","getItemClickable","getItemLabel","getItemOnClick","getItemRef","className","arrows","hotKeys","outerMostArrows","otherProps","prevButtonRef","nextButtonRef","renderButton","item","type","hotKey","onClick","icon","label","disabled","orientation","wrap","gap","onItemClick","e","PaginationBase"],"sources":["../../../../../../src/components/PaginationCanary/PaginationBase/PaginationBase.tsx"],"sourcesContent":["import './PaginationBase.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { useRefs } from '##/hooks/useRefs';\nimport { cnMixFlex } from '##/mixs/MixFlex';\nimport { cn } from '##/utils/bem';\n\nimport { paginationArrowIconsMap, withDefaultGetters } from '../helpers';\nimport { PaginationArrow } from '../PaginationArrow';\nimport { PaginationList } from '../PaginationList';\nimport {\n PaginationArrowTypes,\n PaginationBaseComponent,\n PaginationBaseItemDefault,\n PaginationBasePropArrow,\n PaginationBaseProps,\n paginationPropFormDefault,\n PaginationPropHotKey,\n PaginationPropOnItemClick,\n paginationPropSizeDefault,\n} from '../types';\nimport { usePaginationKeys } from '../usePaginationKeys';\n\nconst cnPaginationBase = cn('PaginationBase');\n\nconst PaginationBaseRender = (\n props: PaginationBaseProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n items = [],\n value,\n size = paginationPropSizeDefault,\n form = paginationPropFormDefault,\n containerEventListener,\n onChange,\n getItemKey,\n getItemAs,\n getItemAttributes,\n getItemClickable,\n getItemLabel,\n getItemOnClick,\n getItemRef,\n className,\n arrows,\n hotKeys,\n outerMostArrows,\n ...otherProps\n } = withDefaultGetters(props);\n\n const [prevButtonRef, nextButtonRef] = useRefs<HTMLButtonElement>(2);\n\n usePaginationKeys({\n prevButtonRef,\n nextButtonRef,\n containerEventListener,\n hotKeys,\n });\n\n const renderButton = (\n item: PaginationBasePropArrow,\n type: PaginationArrowTypes,\n ref: React.Ref<HTMLButtonElement> | undefined,\n hotKey?: PaginationPropHotKey,\n ) => {\n if (!item) {\n return null;\n }\n const {\n onClick,\n icon = paginationArrowIconsMap[type],\n label,\n disabled,\n } = item;\n const orientation =\n type === 'first' || type === 'previous' ? 'start' : 'end';\n\n return (\n <PaginationArrow\n label={label}\n icon={icon}\n disabled={disabled}\n ref={ref}\n size={size}\n form={form}\n caption={hotKey?.label}\n orientation={orientation}\n onClick={onClick}\n />\n );\n };\n\n const onItemClick: PaginationPropOnItemClick<PaginationBaseItemDefault> = (\n item,\n { e },\n ) => {\n onChange?.(item, { e });\n };\n\n return (\n <div\n className={cnPaginationBase(null, [\n className,\n cnMixFlex({ wrap: 'nowrap', gap: '3xs' }),\n ])}\n ref={ref}\n {...otherProps}\n >\n {outerMostArrows?.[0] &&\n renderButton(outerMostArrows[0], 'first', undefined)}\n {arrows?.[0] &&\n renderButton(arrows[0], 'previous', prevButtonRef, hotKeys?.[0])}\n <PaginationList\n items={items}\n size={size}\n form={form}\n value={value}\n onItemClick={onItemClick}\n getItemKey={getItemKey}\n getItemAs={getItemAs}\n getItemAttributes={getItemAttributes}\n getItemClickable={getItemClickable}\n getItemLabel={getItemLabel}\n getItemOnClick={getItemOnClick}\n getItemRef={getItemRef}\n />\n {arrows?.[1] &&\n renderButton(arrows[1], 'next', nextButtonRef, hotKeys?.[1])}\n {outerMostArrows?.[1] &&\n renderButton(outerMostArrows[1], 'last', undefined)}\n </div>\n );\n};\n\nexport const PaginationBase = forwardRef(\n PaginationBaseRender,\n) as PaginationBaseComponent;\n"],"mappings":"sYAAA,6BAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,OAAT,8BACA,OAASC,SAAT,6BACA,OAASC,EAAT,0BAEA,OAASC,uBAAT,CAAkCC,kBAAlC,kBACA,OAASC,eAAT,0BACA,OAASC,cAAT,yBACA,OAMEC,yBANF,CASEC,yBATF,gBAWA,OAASC,iBAAT,4B,GAEMC,iBAAgB,CAAGR,EAAE,CAAC,gBAAD,C,CAErBS,oBAAoB,CAAG,SAC3BC,CAD2B,CAE3BC,CAF2B,CAGxB,OAoBCT,kBAAkB,CAACQ,CAAD,CApBnB,KAEDE,KAFC,CAEDA,CAFC,YAEO,EAFP,GAGDC,CAHC,GAGDA,KAHC,KAIDC,IAJC,CAIDA,CAJC,YAIMR,yBAJN,OAKDS,IALC,CAKDA,CALC,YAKMV,yBALN,GAMDW,CANC,GAMDA,sBANC,CAODC,CAPC,GAODA,QAPC,CAQDC,CARC,GAQDA,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A3BhB,CA4BG,QAAAC,CAAe,WAAfA,CAAA,QAAAA,CAAe,CAAG,CAAH,CAAf,GACCI,CAAY,CAACJ,CAAe,CAAC,CAAD,CAAhB,CAAqB,MAArB,QA7BhB,CAgCH,C,CAED,MAAO,IAAMiB,eAAc,CAAGhD,UAAU,CACtCY,oBADsC,CAAjC"}
@@ -0,0 +1 @@
1
+ export * from './PaginationBase';
@@ -0,0 +1,2 @@
1
+ export*from"./PaginationBase";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/components/PaginationCanary/PaginationBase/index.ts"],"sourcesContent":["export * from './PaginationBase';\n"],"mappings":"AAAA"}
@@ -0,0 +1,3 @@
1
+ import './Pagination.css';
2
+ import { PaginationComponent } from './types';
3
+ export declare const Pagination: PaginationComponent;