@consta/uikit 5.21.0 → 5.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__internal__/src/components/AutoComplete/types.d.ts +1 -1
- package/__internal__/src/components/AutoComplete/types.js.map +1 -1
- package/__internal__/src/components/AutoCompleteCanary/types.d.ts +3 -3
- package/__internal__/src/components/AutoCompleteCanary/types.js.map +1 -1
- package/__internal__/src/components/AvatarGroup/helpers.d.ts +66 -56
- package/__internal__/src/components/AvatarGroup/types.d.ts +1 -1
- package/__internal__/src/components/AvatarGroup/types.js.map +1 -1
- package/__internal__/src/components/BadgeGroup/types.d.ts +1 -1
- package/__internal__/src/components/BadgeGroup/types.js.map +1 -1
- package/__internal__/src/components/BookmarkTabs/BookmarkTabs.js.map +1 -1
- package/__internal__/src/components/BookmarkTabs/BookmarkTabsTab/BookmarkTabsTab.css +1 -1
- package/__internal__/src/components/BookmarkTabs/helper.d.ts +66 -56
- package/__internal__/src/components/BookmarkTabs/types.d.ts +3 -3
- package/__internal__/src/components/BookmarkTabs/types.js.map +1 -1
- package/__internal__/src/components/Breadcrumbs/BreadcrumbsMore/BreadcrumbsMore.d.ts +1 -1
- package/__internal__/src/components/Breadcrumbs/helpers.d.ts +66 -56
- package/__internal__/src/components/Breadcrumbs/types.d.ts +7 -7
- package/__internal__/src/components/Breadcrumbs/types.js.map +1 -1
- package/__internal__/src/components/Card/Card.d.ts +3 -2
- package/__internal__/src/components/Card/Card.js.map +1 -1
- package/__internal__/src/components/CheckboxGroup/helper.d.ts +66 -56
- package/__internal__/src/components/CheckboxGroup/types.d.ts +1 -1
- package/__internal__/src/components/CheckboxGroup/types.js.map +1 -1
- package/__internal__/src/components/Chips/ChipsChoice/types.d.ts +1 -1
- package/__internal__/src/components/Chips/ChipsChoice/types.js.map +1 -1
- package/__internal__/src/components/Chips/types.d.ts +1 -1
- package/__internal__/src/components/Chips/types.js.map +1 -1
- package/__internal__/src/components/ChoiceGroup/helper.d.ts +66 -56
- package/__internal__/src/components/ChoiceGroup/types.d.ts +1 -1
- package/__internal__/src/components/ChoiceGroup/types.js.map +1 -1
- package/__internal__/src/components/Collapse/types.d.ts +1 -1
- package/__internal__/src/components/Collapse/types.js.map +1 -1
- package/__internal__/src/components/CollapseGroup/helpers.d.ts +2 -2
- package/__internal__/src/components/CollapseGroup/helpers.js.map +1 -1
- package/__internal__/src/components/Combobox/helpers.d.ts +4 -4
- package/__internal__/src/components/Combobox/helpers.js.map +1 -1
- package/__internal__/src/components/ComboboxDeprecated/helpers.d.ts +4 -4
- package/__internal__/src/components/ComboboxDeprecated/helpers.js.map +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuLevelWrapper/ContextMenuLevelWrapper.d.ts +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuWrapper/ContextMenuWrapper.d.ts +1 -1
- package/__internal__/src/components/ContextMenu/helpers.d.ts +2 -2
- package/__internal__/src/components/ContextMenu/types.d.ts +4 -4
- package/__internal__/src/components/ContextMenu/types.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerDropdown/DatePickerDropdown.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerDropdown/DatePickerDropdown.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDate/DatePickerFieldTypeDate.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTimeRange/DatePickerFieldTypeDateTimeRange.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonth/DatePickerFieldTypeMonth.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonthRange/DatePickerFieldTypeMonthRange.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/DatePickerFieldTypeTime.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeYear/DatePickerFieldTypeYear.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeYearRange/DatePickerFieldTypeYearRange.d.ts +1 -1
- package/__internal__/src/components/DatePicker/types.d.ts +2 -2
- package/__internal__/src/components/DatePicker/types.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeCell/DateTimeCell.d.ts +1 -1
- package/__internal__/src/components/DateTime/DateTimeItem/DateTimeItem.d.ts +1 -1
- package/__internal__/src/components/DateTime/helpers/types.d.ts +2 -2
- package/__internal__/src/components/DateTime/helpers/types.js.map +1 -1
- package/__internal__/src/components/EventInterceptor/EventInterceptor.d.ts +1 -1
- package/__internal__/src/components/FieldComponents/FieldArrayValueInlineControl/types.d.ts +1 -1
- package/__internal__/src/components/FieldComponents/FieldArrayValueInlineControl/types.js.map +1 -1
- package/__internal__/src/components/FieldComponents/FieldButton/FieldButton.d.ts +1 -1
- package/__internal__/src/components/FieldComponents/FieldClearButton/FieldClearButton.d.ts +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/FieldControlLayout.d.ts +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/helpers.d.ts +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/helpers.js.map +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/types.d.ts +2 -2
- package/__internal__/src/components/FieldComponents/FieldControlLayout/types.js.map +1 -1
- package/__internal__/src/components/FieldComponents/FieldCounter/FieldCounter.d.ts +1 -1
- package/__internal__/src/components/FieldComponents/FieldInput/FieldInput.d.ts +1 -1
- package/__internal__/src/components/FieldComponents/FieldToggleVisiblePasswordButton/FieldToggleVisiblePasswordButton.d.ts +1 -1
- package/__internal__/src/components/FieldComponents/renderSide.d.ts +1 -1
- package/__internal__/src/components/Grid/helpers.d.ts +1 -1
- package/__internal__/src/components/ListCanary/ListAddItem/ListAddItem.d.ts +1 -1
- package/__internal__/src/components/ListCanary/ListBox/ListBox.d.ts +1 -1
- package/__internal__/src/components/ListCanary/ListDivider/ListDivider.d.ts +1 -1
- package/__internal__/src/components/ListCanary/ListGroupLabel/ListGroupLabel.d.ts +1 -1
- package/__internal__/src/components/ListCanary/ListLoader/ListLoader.d.ts +1 -1
- package/__internal__/src/components/ListCanary/types.d.ts +3 -3
- package/__internal__/src/components/ListCanary/types.js.map +1 -1
- package/__internal__/src/components/Modal/Modal.js +1 -1
- package/__internal__/src/components/Modal/Modal.js.map +1 -1
- package/__internal__/src/components/Pagination/PaginationArrow/PaginationArrow.d.ts +1 -1
- package/__internal__/src/components/Pagination/types.d.ts +3 -3
- package/__internal__/src/components/Pagination/types.js.map +1 -1
- package/__internal__/src/components/PaginationDeprecated/PaginationDeprecated.d.ts +1 -1
- package/__internal__/src/components/PaginationDeprecated/PaginationDeprecated.js.map +1 -1
- package/__internal__/src/components/Picture/Picture.d.ts +1 -1
- package/__internal__/src/components/Popover/Popover.d.ts +1 -1
- package/__internal__/src/components/Popover/Popover.js +1 -1
- package/__internal__/src/components/Popover/Popover.js.map +1 -1
- package/__internal__/src/components/PortalWithTheme/PortalWithTheme.d.ts +1 -1
- package/__internal__/src/components/PortalWithTheme/PortalWithTheme.js +1 -1
- package/__internal__/src/components/PortalWithTheme/PortalWithTheme.js.map +1 -1
- package/__internal__/src/components/PortalWithTheme/PortalWithThemeConsumer/PortalWithThemeConsumer.d.ts +10 -0
- package/__internal__/src/components/PortalWithTheme/PortalWithThemeConsumer/PortalWithThemeConsumer.js +2 -0
- package/__internal__/src/components/PortalWithTheme/PortalWithThemeConsumer/PortalWithThemeConsumer.js.map +1 -0
- package/__internal__/src/components/PortalWithTheme/PortalWithThemeConsumer/index.d.ts +1 -0
- package/__internal__/src/components/PortalWithTheme/PortalWithThemeConsumer/index.js +2 -0
- package/__internal__/src/components/PortalWithTheme/PortalWithThemeConsumer/index.js.map +1 -0
- package/__internal__/src/components/PortalWithTheme/index.d.ts +1 -0
- package/__internal__/src/components/PortalWithTheme/index.js +1 -1
- package/__internal__/src/components/PortalWithTheme/index.js.map +1 -1
- package/__internal__/src/components/ProgressLine/helpers.d.ts +66 -56
- package/__internal__/src/components/ProgressLine/types.d.ts +1 -1
- package/__internal__/src/components/ProgressLine/types.js.map +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarLine/ProgressStepBarLine.d.ts +1 -1
- package/__internal__/src/components/ProgressStepBar/helpers.d.ts +3 -3
- package/__internal__/src/components/ProgressStepBar/helpers.js.map +1 -1
- package/__internal__/src/components/RadioGroup/helper.d.ts +66 -56
- package/__internal__/src/components/RadioGroup/types.d.ts +1 -1
- package/__internal__/src/components/RadioGroup/types.js.map +1 -1
- package/__internal__/src/components/Select/helpers.d.ts +4 -4
- package/__internal__/src/components/Select/helpers.js.map +1 -1
- package/__internal__/src/components/SelectCanary/SelectControlLayout/SelectControlLayout.d.ts +1 -1
- package/__internal__/src/components/SelectCanary/SelectCreateButton/SelectCreateButton.d.ts +1 -1
- package/__internal__/src/components/SelectCanary/SelectCreateButton/SelectCreateButton.js.map +1 -1
- package/__internal__/src/components/SelectCanary/SelectDropdown/SelectDropdown.d.ts +1 -1
- package/__internal__/src/components/SelectCanary/SelectDropdown/SelectDropdown.js.map +1 -1
- package/__internal__/src/components/SelectCanary/SelectInput/SelectInput.d.ts +1 -1
- package/__internal__/src/components/SelectCanary/SelectLoader/SelectLoader.d.ts +1 -1
- package/__internal__/src/components/SelectCanary/SelectMultipleValue/SelectMultipleValue.d.ts +2 -2
- package/__internal__/src/components/SelectCanary/SelectMultipleValue/SelectMultipleValue.js.map +1 -1
- package/__internal__/src/components/SelectCanary/SelectRenderItem/SelectRenderItem.d.ts +1 -1
- package/__internal__/src/components/SelectCanary/SelectRenderItem/SelectRenderItem.js.map +1 -1
- package/__internal__/src/components/SelectCanary/helpers.d.ts +1 -1
- package/__internal__/src/components/SelectCanary/types.d.ts +1 -1
- package/__internal__/src/components/SelectCanary/types.js.map +1 -1
- package/__internal__/src/components/SelectComponents/SelectContainer/SelectContainer.d.ts +1 -1
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.d.ts +2 -2
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js.map +1 -1
- package/__internal__/src/components/SelectComponents/SelectLoader/SelectLoader.d.ts +1 -1
- package/__internal__/src/components/SelectComponentsDeprecated/SelectContainer/SelectContainer.d.ts +1 -1
- package/__internal__/src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.d.ts +2 -2
- package/__internal__/src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.js.map +1 -1
- package/__internal__/src/components/SelectComponentsDeprecated/SelectItemAll/SelectSelectAll.d.ts +1 -1
- package/__internal__/src/components/SelectComponentsDeprecated/SelectLoader/SelectLoader.d.ts +1 -1
- package/__internal__/src/components/SelectDeprecated/helpers.d.ts +4 -4
- package/__internal__/src/components/SelectDeprecated/helpers.js.map +1 -1
- package/__internal__/src/components/Sidebar/Sidebar.js +1 -1
- package/__internal__/src/components/Sidebar/Sidebar.js.map +1 -1
- package/__internal__/src/components/Skeleton/SkeletonBrick/SkeletonBrick.d.ts +1 -1
- package/__internal__/src/components/Skeleton/SkeletonCircle/SkeletonCircle.d.ts +1 -1
- package/__internal__/src/components/Slider/SliderInput/SliderInput.d.ts +1 -1
- package/__internal__/src/components/Slider/SliderLine/SliderLine.d.ts +1 -1
- package/__internal__/src/components/Slider/SliderPoint/SliderPoint.d.ts +1 -1
- package/__internal__/src/components/Slider/helper.d.ts +1 -1
- package/__internal__/src/components/Slider/helper.js.map +1 -1
- package/__internal__/src/components/SnackBar/SnackBarItem/SnackBarItem.d.ts +1 -1
- package/__internal__/src/components/SnackBar/helper.d.ts +67 -57
- package/__internal__/src/components/SnackBar/types.d.ts +2 -2
- package/__internal__/src/components/SnackBar/types.js.map +1 -1
- package/__internal__/src/components/Steps/helper.d.ts +66 -56
- package/__internal__/src/components/Steps/types.d.ts +1 -1
- package/__internal__/src/components/Steps/types.js.map +1 -1
- package/__internal__/src/components/StepsCanary/helper.d.ts +66 -56
- package/__internal__/src/components/StepsCanary/types.d.ts +1 -1
- package/__internal__/src/components/StepsCanary/types.js.map +1 -1
- package/__internal__/src/components/Switch/Switch.d.ts +2 -1
- package/__internal__/src/components/Switch/Switch.js +1 -1
- package/__internal__/src/components/Switch/Switch.js.map +1 -1
- package/__internal__/src/components/Switch/types.d.ts +1 -0
- package/__internal__/src/components/Switch/types.js.map +1 -1
- package/__internal__/src/components/SwitchGroup/helpers.d.ts +66 -56
- package/__internal__/src/components/SwitchGroup/types.d.ts +1 -1
- package/__internal__/src/components/SwitchGroup/types.js.map +1 -1
- package/__internal__/src/components/Table/Cell/TableCell.d.ts +1 -1
- package/__internal__/src/components/Table/Cell/TableCell.js.map +1 -1
- package/__internal__/src/components/Table/Header/TableHeader.d.ts +1 -1
- package/__internal__/src/components/Table/Header/TableHeader.js.map +1 -1
- package/__internal__/src/components/Table/Resizer/TableResizer.d.ts +1 -1
- package/__internal__/src/components/Table/Resizer/TableResizer.js.map +1 -1
- package/__internal__/src/components/Table/Table.d.ts +1 -1
- package/__internal__/src/components/Table/Table.js.map +1 -1
- package/__internal__/src/components/Table/__mock__/data.mock.d.ts +1 -1
- package/__internal__/src/components/Tabs/Tabs.js.map +1 -1
- package/__internal__/src/components/Tabs/TabsFitModeDropdownWrapper/TabsFitModeDropdownWrapper.d.ts +1 -1
- package/__internal__/src/components/Tabs/TabsFitModeDropdownWrapper/TabsFitModeDropdownWrapper.js.map +1 -1
- package/__internal__/src/components/Tabs/TabsFitModeScrollWrapper/TabsFitModeScrollWrapper.d.ts +1 -1
- package/__internal__/src/components/Tabs/TabsFitModeScrollWrapper/TabsFitModeScrollWrapper.js.map +1 -1
- package/__internal__/src/components/Tabs/TabsListWrapper/TabsListWrapper.d.ts +1 -1
- package/__internal__/src/components/Tabs/helpers.d.ts +199 -169
- package/__internal__/src/components/Tabs/types.d.ts +4 -4
- package/__internal__/src/components/Tabs/types.js.map +1 -1
- package/__internal__/src/components/Tag/Tag.d.ts +1 -1
- package/__internal__/src/components/Tag/Tag.js.map +1 -1
- package/__internal__/src/components/TagBase/TagBase.d.ts +1 -1
- package/__internal__/src/components/TextField/TextField.d.ts +1 -1
- package/__internal__/src/components/TextField/types.d.ts +1 -1
- package/__internal__/src/components/TextField/types.js.map +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldTypeTextArray/TextFieldTypeTextArray.js +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldTypeTextArray/TextFieldTypeTextArray.js.map +1 -1
- package/__internal__/src/components/TextFieldCanary/types.d.ts +2 -2
- package/__internal__/src/components/TextFieldCanary/types.js.map +1 -1
- package/__internal__/src/components/ThemeToggler/helpers.d.ts +66 -56
- package/__internal__/src/components/ThemeToggler/types.d.ts +1 -1
- package/__internal__/src/components/ThemeToggler/types.js.map +1 -1
- package/__internal__/src/components/Timer/Timer.d.ts +1 -1
- package/__internal__/src/components/Tooltip/Tooltip.d.ts +1 -1
- package/__internal__/src/components/TooltipDeprecated/TooltipDeprecated.d.ts +1 -1
- package/__internal__/src/components/UserSelect/helpers.d.ts +4 -4
- package/__internal__/src/components/UserSelect/helpers.js.map +1 -1
- package/__internal__/src/components/UserSelectDeprecated/helpers.d.ts +4 -4
- package/__internal__/src/components/UserSelectDeprecated/helpers.js.map +1 -1
- package/__internal__/src/docs/start/start.stand.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconAvi/FileIconAvi_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconAvi/FileIconAvi_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconBmp/FileIconBmp_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconBmp/FileIconBmp_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconCsv/FileIconCsv_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconCsv/FileIconCsv_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconDoc/FileIconDoc_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconDoc/FileIconDoc_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconExe/FileIconExe_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconExe/FileIconExe_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconGif/FileIconGif_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconGif/FileIconGif_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconJpg/FileIconJpg_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconJpg/FileIconJpg_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconJson/FileIconJson_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconJson/FileIconJson_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconLoading/FileIconLoading_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconLoading/FileIconLoading_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconMov/FileIconMov_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconMov/FileIconMov_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconMp3/FileIconMp3_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconMp3/FileIconMp3_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconMp4/FileIconMp4_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconMp4/FileIconMp4_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconMsg/FileIconMsg_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconMsg/FileIconMsg_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconPdf/FileIconPdf_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconPdf/FileIconPdf_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconPng/FileIconPng_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconPng/FileIconPng_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconPpt/FileIconPpt_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconPpt/FileIconPpt_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconRar/FileIconRar_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconRar/FileIconRar_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconRtf/FileIconRtf_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconRtf/FileIconRtf_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconSvg/FileIconSvg_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconSvg/FileIconSvg_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconTiff/FileIconTiff_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconTiff/FileIconTiff_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconTxt/FileIconTxt_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconTxt/FileIconTxt_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconUndefined/FileIconUndefined_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconUndefined/FileIconUndefined_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconVsd/FileIconVsd_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconVsd/FileIconVsd_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconWav/FileIconWav_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconWav/FileIconWav_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconXls/FileIconXls_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconXls/FileIconXls_size_s.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconZip/FileIconZip_size_m.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIconZip/FileIconZip_size_s.d.ts +1 -1
- package/__internal__/src/hocs/withTooltip/withTooltip.d.ts +1 -1
- package/__internal__/src/hocs/withTooltip/withTooltip.js.map +1 -1
- package/__internal__/src/hooks/useForkRef/useForkRef.d.ts +1 -1
- package/__internal__/src/responsesImages/ResponsesImage403/ResponsesImage403Svg.d.ts +1 -1
- package/__internal__/src/responsesImages/ResponsesImage404/ResponsesImage404Svg.d.ts +1 -1
- package/__internal__/src/responsesImages/ResponsesImage500/ResponsesImage500Svg.d.ts +1 -1
- package/__internal__/src/responsesImages/ResponsesImage503/ResponsesImage503Svg.d.ts +1 -1
- package/__internal__/src/responsesImages/ResponsesImageConnectionError/ResponsesImageConnectionErrorSvg.d.ts +1 -1
- package/__internal__/src/responsesImages/ResponsesImageDeleted/ResponsesImageDeletedSvg.d.ts +1 -1
- package/__internal__/src/responsesImages/ResponsesImageEmptyBox/ResponsesImageEmptyBoxSvg.d.ts +1 -1
- package/__internal__/src/responsesImages/ResponsesImageEmptyPockets/ResponsesImageEmptyPocketsSvg.d.ts +1 -1
- package/__internal__/src/responsesImages/ResponsesImageExit/ResponsesImageExitSvg.d.ts +1 -1
- package/__internal__/src/responsesImages/ResponsesImageNothingFound/ResponsesImageNothingFoundSvg.d.ts +1 -1
- package/__internal__/src/responsesImages/ResponsesImageSuccess/ResponsesImageSuccessSvg.d.ts +1 -1
- package/__internal__/src/stand/standConfig.d.ts +1 -1
- package/__internal__/src/uiKit/components/Image/Image.d.ts +1 -1
- package/__internal__/src/utils/state/withCtx/withCtx.js.map +1 -1
- package/__internal__/src/utils/types/PropsWithAsAttributes.d.ts +2 -2
- package/__internal__/src/utils/types/PropsWithAsAttributes.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/components/SelectCanary/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport {\n FieldPropForm,\n FieldPropSize,\n FieldPropStatus,\n FieldPropView,\n} from '##/components/FieldComponents';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport type RenderItemProps<ITEM> = {\n item: ITEM;\n active: boolean;\n hovered: boolean;\n onClick: (e: React.MouseEvent) => void;\n onMouseEnter: (e: React.MouseEvent) => void;\n ref: React.Ref<HTMLDivElement>;\n};\n\nexport type SelectItemDefault = {\n label: string;\n id: string | number;\n groupId?: string | number;\n disabled?: boolean;\n};\n\nexport type SelectGroupDefault = {\n label: string;\n id: string | number;\n};\n\nexport type SelectPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type SelectPropGetItemKey<ITEM> = (item: ITEM) => string | number;\nexport type SelectPropGetItemGroupKey<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\nexport type SelectPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\nexport type SelectPropGetGroupKey<GROUP> = (group: GROUP) => string | number;\nexport type SelectPropGetGroupLabel<GROUP> = (group: GROUP) => string;\n\nexport type SelectPropOnChange<ITEM, MULTIPLE extends boolean> = (\n value: (MULTIPLE extends true ? ITEM[] : ITEM) | null,\n props: {\n e: React.SyntheticEvent;\n },\n) => void;\nexport type SelectPropValue<ITEM, MULTIPLE extends boolean> =\n | (MULTIPLE extends true ? ITEM[] : ITEM)\n | null\n | undefined;\n\nexport type SelectPropRenderItem<ITEM> = (\n props: RenderItemProps<ITEM>,\n) => React.ReactNode | null;\n\nexport type SelectPropRenderValue<ITEM, MULTIPLE> = MULTIPLE extends true\n ? (props: {\n value: ITEM[];\n getRemove: (\n item: ITEM,\n ) => (e: React.SyntheticEvent<Element, Event>) => void;\n }) => React.ReactNode | null\n : (props: { value: ITEM }) => React.ReactNode | null;\n\nexport type SelectPropOnCreate = (\n label: string,\n props: { e: React.SyntheticEvent },\n) => void;\n\nexport type SelectAllItem = {\n groupKey: string | number;\n __optionSelectAll: true;\n};\n\nexport type Group<ITEM, GROUP> = {\n items: ITEM[];\n key: string | number;\n group?: GROUP;\n};\n\nexport type CountedGroup<ITEM, GROUP> = Omit<Group<ITEM, GROUP>, 'items'> & {\n items: Array<SelectAllItem | ITEM>;\n};\n\nexport type SelectPropsInit<\n ITEM = SelectItemDefault,\n GROUP = SelectGroupDefault,\n MULTIPLE extends boolean = false,\n> = PropsWithHTMLAttributesAndRef<\n {\n 'items': ITEM[];\n 'onChange': SelectPropOnChange<ITEM, MULTIPLE>;\n 'disabled'?: boolean;\n 'form'?: FieldPropForm;\n 'dropdownForm'?: 'default' | 'brick' | 'round';\n 'size'?: FieldPropSize;\n 'view'?: FieldPropView;\n 'placeholder'?: string;\n 'aria-Label'?: string;\n 'status'?: FieldPropStatus;\n 'isLoading'?: boolean;\n 'dropdownClassName'?: string;\n 'dropdownRef'?: React.Ref<HTMLDivElement>;\n 'renderItem'?: SelectPropRenderItem<ITEM>;\n 'renderValue'?: SelectPropRenderValue<ITEM, MULTIPLE>;\n 'onFocus'?: React.FocusEventHandler<HTMLInputElement>;\n 'onBlur'?: React.FocusEventHandler<HTMLInputElement>;\n 'onCreate'?: SelectPropOnCreate;\n 'inputRef'?: React.Ref<HTMLInputElement>;\n 'input'?: boolean;\n 'inputValue'?: string;\n 'inputDefaultValue'?: string;\n 'onInput'?: (value: string) => void;\n 'labelForCreate'?:\n | ((label: string | undefined) => React.ReactNode)\n | React.ReactNode;\n 'labelForEmptyItems'?: string;\n 'multiple'?: MULTIPLE;\n 'value'?: SelectPropValue<ITEM, MULTIPLE>;\n 'groups'?: GROUP[];\n 'getItemLabel'?: SelectPropGetItemLabel<ITEM>;\n 'getItemKey'?: SelectPropGetItemKey<ITEM>;\n 'getItemGroupKey'?: SelectPropGetItemGroupKey<ITEM>;\n 'getItemDisabled'?: SelectPropGetItemDisabled<ITEM>;\n 'getGroupLabel'?: SelectPropGetGroupLabel<GROUP>;\n 'getGroupKey'?: SelectPropGetGroupKey<GROUP>;\n 'virtualScroll'?: boolean;\n 'onScrollToBottom'?: (length: number) => void;\n 'onDropdownOpen'?: (isOpen: boolean) => void;\n 'dropdownOpen'?: boolean;\n 'ignoreOutsideClicksRefs'?: ReadonlyArray<React.RefObject<HTMLElement>>;\n 'clearButton'?: boolean;\n 'iconClear'?: IconComponent;\n 'selectAll'?: MULTIPLE extends true ? boolean : never;\n 'selectAllLabel'?: string;\n },\n HTMLDivElement\n>;\n\nexport type SelectProps<\n ITEM = SelectItemDefault,\n GROUP = SelectGroupDefault,\n MULTIPLE extends boolean = false,\n> = SelectPropsInit<ITEM, GROUP, MULTIPLE> &\n (ITEM extends { label: SelectItemDefault['label'] }\n ? {}\n : { getItemLabel: SelectPropGetItemLabel<ITEM> }) &\n (ITEM extends { id: SelectItemDefault['id'] }\n ? {}\n : { getItemKey: SelectPropGetItemKey<ITEM> }) &\n (GROUP extends { label: SelectGroupDefault['label'] }\n ? {}\n : { getGroupLabel: SelectPropGetGroupLabel<GROUP> }) &\n (GROUP extends { id: SelectGroupDefault['id'] }\n ? {}\n : { getGroupKey: SelectPropGetGroupKey<GROUP> });\n\nexport type SelectComponent = <\n ITEM = SelectItemDefault,\n GROUP = SelectGroupDefault,\n MULTIPLE extends boolean = false,\n>(\n props: SelectProps<ITEM, GROUP, MULTIPLE>,\n) => React.
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/components/SelectCanary/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport {\n FieldPropForm,\n FieldPropSize,\n FieldPropStatus,\n FieldPropView,\n} from '##/components/FieldComponents';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport type RenderItemProps<ITEM> = {\n item: ITEM;\n active: boolean;\n hovered: boolean;\n onClick: (e: React.MouseEvent) => void;\n onMouseEnter: (e: React.MouseEvent) => void;\n ref: React.Ref<HTMLDivElement>;\n};\n\nexport type SelectItemDefault = {\n label: string;\n id: string | number;\n groupId?: string | number;\n disabled?: boolean;\n};\n\nexport type SelectGroupDefault = {\n label: string;\n id: string | number;\n};\n\nexport type SelectPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type SelectPropGetItemKey<ITEM> = (item: ITEM) => string | number;\nexport type SelectPropGetItemGroupKey<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\nexport type SelectPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\nexport type SelectPropGetGroupKey<GROUP> = (group: GROUP) => string | number;\nexport type SelectPropGetGroupLabel<GROUP> = (group: GROUP) => string;\n\nexport type SelectPropOnChange<ITEM, MULTIPLE extends boolean> = (\n value: (MULTIPLE extends true ? ITEM[] : ITEM) | null,\n props: {\n e: React.SyntheticEvent;\n },\n) => void;\nexport type SelectPropValue<ITEM, MULTIPLE extends boolean> =\n | (MULTIPLE extends true ? ITEM[] : ITEM)\n | null\n | undefined;\n\nexport type SelectPropRenderItem<ITEM> = (\n props: RenderItemProps<ITEM>,\n) => React.ReactNode | null;\n\nexport type SelectPropRenderValue<ITEM, MULTIPLE> = MULTIPLE extends true\n ? (props: {\n value: ITEM[];\n getRemove: (\n item: ITEM,\n ) => (e: React.SyntheticEvent<Element, Event>) => void;\n }) => React.ReactNode | null\n : (props: { value: ITEM }) => React.ReactNode | null;\n\nexport type SelectPropOnCreate = (\n label: string,\n props: { e: React.SyntheticEvent },\n) => void;\n\nexport type SelectAllItem = {\n groupKey: string | number;\n __optionSelectAll: true;\n};\n\nexport type Group<ITEM, GROUP> = {\n items: ITEM[];\n key: string | number;\n group?: GROUP;\n};\n\nexport type CountedGroup<ITEM, GROUP> = Omit<Group<ITEM, GROUP>, 'items'> & {\n items: Array<SelectAllItem | ITEM>;\n};\n\nexport type SelectPropsInit<\n ITEM = SelectItemDefault,\n GROUP = SelectGroupDefault,\n MULTIPLE extends boolean = false,\n> = PropsWithHTMLAttributesAndRef<\n {\n 'items': ITEM[];\n 'onChange': SelectPropOnChange<ITEM, MULTIPLE>;\n 'disabled'?: boolean;\n 'form'?: FieldPropForm;\n 'dropdownForm'?: 'default' | 'brick' | 'round';\n 'size'?: FieldPropSize;\n 'view'?: FieldPropView;\n 'placeholder'?: string;\n 'aria-Label'?: string;\n 'status'?: FieldPropStatus;\n 'isLoading'?: boolean;\n 'dropdownClassName'?: string;\n 'dropdownRef'?: React.Ref<HTMLDivElement>;\n 'renderItem'?: SelectPropRenderItem<ITEM>;\n 'renderValue'?: SelectPropRenderValue<ITEM, MULTIPLE>;\n 'onFocus'?: React.FocusEventHandler<HTMLInputElement>;\n 'onBlur'?: React.FocusEventHandler<HTMLInputElement>;\n 'onCreate'?: SelectPropOnCreate;\n 'inputRef'?: React.Ref<HTMLInputElement>;\n 'input'?: boolean;\n 'inputValue'?: string;\n 'inputDefaultValue'?: string;\n 'onInput'?: (value: string) => void;\n 'labelForCreate'?:\n | ((label: string | undefined) => React.ReactNode)\n | React.ReactNode;\n 'labelForEmptyItems'?: string;\n 'multiple'?: MULTIPLE;\n 'value'?: SelectPropValue<ITEM, MULTIPLE>;\n 'groups'?: GROUP[];\n 'getItemLabel'?: SelectPropGetItemLabel<ITEM>;\n 'getItemKey'?: SelectPropGetItemKey<ITEM>;\n 'getItemGroupKey'?: SelectPropGetItemGroupKey<ITEM>;\n 'getItemDisabled'?: SelectPropGetItemDisabled<ITEM>;\n 'getGroupLabel'?: SelectPropGetGroupLabel<GROUP>;\n 'getGroupKey'?: SelectPropGetGroupKey<GROUP>;\n 'virtualScroll'?: boolean;\n 'onScrollToBottom'?: (length: number) => void;\n 'onDropdownOpen'?: (isOpen: boolean) => void;\n 'dropdownOpen'?: boolean;\n 'ignoreOutsideClicksRefs'?: ReadonlyArray<React.RefObject<HTMLElement>>;\n 'clearButton'?: boolean;\n 'iconClear'?: IconComponent;\n 'selectAll'?: MULTIPLE extends true ? boolean : never;\n 'selectAllLabel'?: string;\n },\n HTMLDivElement\n>;\n\nexport type SelectProps<\n ITEM = SelectItemDefault,\n GROUP = SelectGroupDefault,\n MULTIPLE extends boolean = false,\n> = SelectPropsInit<ITEM, GROUP, MULTIPLE> &\n (ITEM extends { label: SelectItemDefault['label'] }\n ? {}\n : { getItemLabel: SelectPropGetItemLabel<ITEM> }) &\n (ITEM extends { id: SelectItemDefault['id'] }\n ? {}\n : { getItemKey: SelectPropGetItemKey<ITEM> }) &\n (GROUP extends { label: SelectGroupDefault['label'] }\n ? {}\n : { getGroupLabel: SelectPropGetGroupLabel<GROUP> }) &\n (GROUP extends { id: SelectGroupDefault['id'] }\n ? {}\n : { getGroupKey: SelectPropGetGroupKey<GROUP> });\n\nexport type SelectComponent = <\n ITEM = SelectItemDefault,\n GROUP = SelectGroupDefault,\n MULTIPLE extends boolean = false,\n>(\n props: SelectProps<ITEM, GROUP, MULTIPLE>,\n) => React.ReactNode | null;\n"],"mappings":""}
|
|
@@ -17,4 +17,4 @@ export type SelectContainerProps = PropsWithHTMLAttributesAndRef<{
|
|
|
17
17
|
labelPosition?: 'top' | 'left';
|
|
18
18
|
caption?: string;
|
|
19
19
|
}, HTMLDivElement>;
|
|
20
|
-
export declare const SelectContainer: React.ForwardRefExoticComponent<
|
|
20
|
+
export declare const SelectContainer: React.ForwardRefExoticComponent<Omit<SelectContainerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -17,7 +17,7 @@ type Props<ITEM, GROUP> = PropsWithJsxAttributes<{
|
|
|
17
17
|
isOpen: boolean;
|
|
18
18
|
offset?: PopoverPropOffset | 'none';
|
|
19
19
|
isLoading?: boolean;
|
|
20
|
-
renderItem: (props: RenderItemProps<ITEM>) =>
|
|
20
|
+
renderItem: (props: RenderItemProps<ITEM>) => React.ReactNode | null;
|
|
21
21
|
visibleItems: (OptionForCreate | {
|
|
22
22
|
items: Array<SelectAllItem | ITEM>;
|
|
23
23
|
key: string | number;
|
|
@@ -36,6 +36,6 @@ type Props<ITEM, GROUP> = PropsWithJsxAttributes<{
|
|
|
36
36
|
virtualScroll?: boolean;
|
|
37
37
|
onScrollToBottom?: (length: number) => void;
|
|
38
38
|
}>;
|
|
39
|
-
type SelectDropdownComponent = <ITEM, GROUP>(props: Props<ITEM, GROUP>) => React.
|
|
39
|
+
type SelectDropdownComponent = <ITEM, GROUP>(props: Props<ITEM, GROUP>) => React.ReactNode | null;
|
|
40
40
|
export declare const SelectDropdown: SelectDropdownComponent;
|
|
41
41
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectDropdown.js","names":["React","Fragment","useEffect","useMemo","useRef","Transition","cnListBox","ListItem","ListLoader","mapVerticalSpace","Popover","useDebounce","useFlag","forkRef","useForkRef","useVirtualScroll","animateTimeout","cnMixPopoverAnimate","cnMixScrollBar","cnMixSpace","cn","fabricIndex","SelectCreateButton","SelectGroupLabel","SelectItemAll","SelectLoader","isNotOptionForCreate","isOptionForCreate","isOptionForSelectAll","selectDropdownForm","defaultSelectDropdownPropForm","cnSelectDropdown","getLengthElements","elements","element","length","index","items","isVisible","slice","SelectDropdown","props","controlRef","size","getOptionProps","dropdownRefProp","dropdownRef","labelForCreate","className","labelForNotFound","labelForEmptyItems","hasItems","form","isOpen","offset","offsetProp","renderItem","visibleItems","isLoading","getGroupLabel","notFound","itemsRefs","virtualScroll","onScrollToBottom","otherProps","indent","isListShowed","filter","group","Array","isArray","lengthForVirtualScroll","isActive","spaceTop","sliceHookProp","listRefs","scrollElementRef","popoverRef","scrolled","setScrolled","setScrolledOffDebounce","off","fn","on","current","addEventListener","removeEventListener","animate","getIndex","getVirtualIndex","border","shadow","pV","marginTop","map","groupIndex","label","item","keyPrefix","virtualIndex","key","i","checkedCount","totalCount","ref"],"sources":["../../../../../../src/components/SelectComponents/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["import './SelectDropdown.css';\n\nimport React, { Fragment, useEffect, useMemo, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport {\n cnListBox,\n ListItem,\n ListLoader,\n mapVerticalSpace,\n} from '##/components/ListCanary';\nimport { Popover, PopoverPropOffset } from '##/components/Popover';\nimport { useDebounce } from '##/hooks/useDebounce';\nimport { useFlag } from '##/hooks/useFlag';\nimport { forkRef, useForkRef } from '##/hooks/useForkRef';\nimport { useVirtualScroll } from '##/hooks/useVirtualScroll';\nimport {\n animateTimeout,\n cnMixPopoverAnimate,\n} from '##/mixs/MixPopoverAnimate/MixPopoverAnimate';\nimport { cnMixScrollBar } from '##/mixs/MixScrollBar';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\nimport { fabricIndex } from '##/utils/fabricIndex';\nimport { SelectAllItem } from '##/utils/getGroups';\nimport { PropsWithJsxAttributes } from '##/utils/types/PropsWithJsxAttributes';\n\nimport { SelectCreateButton } from '../SelectCreateButton/SelectCreateButton';\nimport { SelectGroupLabel } from '../SelectGroupLabel/SelectGroupLabel';\nimport { SelectItemAll } from '../SelectItemAll/SelectItemAll';\nimport { SelectLoader } from '../SelectLoader/SelectLoader';\nimport { PropSize, RenderItemProps } from '../types';\nimport {\n GetOptionPropsResult,\n isNotOptionForCreate,\n isOptionForCreate,\n isOptionForSelectAll,\n OptionForCreate,\n OptionProps,\n} from '../useSelect';\n\nexport const selectDropdownForm = ['default', 'brick', 'round'] as const;\nexport type SelectDropdownPropForm = typeof selectDropdownForm[number];\nexport const defaultSelectDropdownPropForm = selectDropdownForm[0];\n\ntype Props<ITEM, GROUP> = PropsWithJsxAttributes<{\n size: PropSize;\n controlRef: React.MutableRefObject<HTMLDivElement | null>;\n dropdownRef: React.Ref<HTMLDivElement>;\n getOptionProps(props: OptionProps<ITEM>): GetOptionPropsResult;\n form: SelectDropdownPropForm;\n isOpen: boolean;\n offset?: PopoverPropOffset | 'none';\n isLoading?: boolean;\n renderItem: (props: RenderItemProps<ITEM>) => JSX.Element | null;\n visibleItems: (\n | OptionForCreate\n | {\n items: Array<SelectAllItem | ITEM>;\n key: string | number;\n group?: GROUP;\n groupIndex: number;\n checkedCount?: number;\n totalCount?: number;\n }\n )[];\n getGroupLabel?: (group: GROUP) => string;\n labelForCreate?: string;\n labelForNotFound?: string;\n labelForEmptyItems?: string;\n notFound?: boolean;\n hasItems?: boolean;\n itemsRefs: React.RefObject<HTMLDivElement>[];\n virtualScroll?: boolean;\n onScrollToBottom?: (length: number) => void;\n}>;\n\ntype SelectDropdownComponent = <ITEM, GROUP>(\n props: Props<ITEM, GROUP>,\n) => React.ReactElement | null;\n\nconst cnSelectDropdown = cn('SelectDropdown');\n\nconst getLengthElements = <ITEM, GROUP>(\n elements: (\n | OptionForCreate\n | {\n items: Array<SelectAllItem | ITEM>;\n key: string | number;\n group?: GROUP;\n groupIndex: number;\n checkedCount?: number;\n totalCount?: number;\n }\n )[],\n) => {\n let length = elements.length <= 1 ? 0 : elements.length;\n\n for (let index = 0; index < elements.length; index++) {\n const element = elements[index];\n\n if (isNotOptionForCreate(element) && element.items.length) {\n length += element.items.length;\n }\n }\n\n return length;\n};\n\nconst isVisible = (slice: [number, number], index: number) => {\n return index >= slice[0] && index < slice[1];\n};\n\nexport const SelectDropdown: SelectDropdownComponent = (props) => {\n const {\n controlRef,\n size,\n getOptionProps,\n dropdownRef: dropdownRefProp,\n labelForCreate,\n className,\n labelForNotFound,\n labelForEmptyItems,\n hasItems = true,\n form,\n isOpen,\n offset: offsetProp = 'none',\n renderItem,\n visibleItems,\n isLoading,\n getGroupLabel,\n notFound,\n itemsRefs,\n virtualScroll,\n onScrollToBottom,\n ...otherProps\n } = props;\n\n const indent = form === 'round' ? 'increased' : 'normal';\n\n const isListShowed = useMemo(() => {\n return (\n visibleItems.filter(\n (group) =>\n isOptionForCreate(group) ||\n (Array.isArray(group.items) && group.items.length > 0),\n ).length > 0\n );\n }, [visibleItems]);\n\n const offset = offsetProp === 'none' ? undefined : offsetProp;\n\n const lengthForVirtualScroll = useMemo(\n () => getLengthElements(visibleItems),\n [visibleItems],\n );\n\n const {\n spaceTop,\n slice: sliceHookProp,\n listRefs,\n scrollElementRef,\n } = useVirtualScroll({\n length: lengthForVirtualScroll,\n isActive: virtualScroll && isOpen,\n onScrollToBottom,\n });\n\n const slice: [number, number] =\n sliceHookProp[0] === 0 && virtualScroll ? [0, 50] : sliceHookProp;\n\n const popoverRef = useRef<HTMLDivElement>(null);\n const dropdownRef = useForkRef([scrollElementRef, dropdownRefProp]);\n const [scrolled, setScrolled] = useFlag();\n const setScrolledOffDebounce = useDebounce(setScrolled.off, 100);\n\n useEffect(() => {\n const fn = () => {\n setScrolled.on();\n setScrolledOffDebounce();\n };\n\n scrollElementRef.current?.addEventListener('scroll', fn);\n\n return () => {\n scrollElementRef.current?.removeEventListener('scroll', fn);\n };\n }, [scrollElementRef.current]);\n\n return (\n <Transition\n in={isOpen}\n unmountOnExit\n nodeRef={popoverRef}\n timeout={animateTimeout}\n >\n {(animate) => {\n const getIndex = fabricIndex();\n const getVirtualIndex = fabricIndex();\n\n return (\n <Popover\n {...otherProps}\n anchorRef={controlRef}\n direction=\"downStartLeft\"\n possibleDirections={[\n 'downStartLeft',\n 'upStartLeft',\n 'downStartRight',\n 'upStartRight',\n ]}\n offset={offset}\n ref={popoverRef}\n role=\"listbox\"\n className={cnSelectDropdown(null, [\n cnListBox({ size, form, border: true, shadow: true }),\n cnMixPopoverAnimate({ animate }),\n className,\n ])}\n equalAnchorWidth\n >\n <div\n className={cnSelectDropdown('ScrollContainer', [\n cnMixSpace({\n pV: mapVerticalSpace[size],\n }),\n cnMixScrollBar(),\n ])}\n ref={dropdownRef}\n >\n {isLoading && !isListShowed && <SelectLoader />}\n <div\n className={cnSelectDropdown('List', { scrolled })}\n style={{ marginTop: spaceTop }}\n >\n {visibleItems.map((group, groupIndex) => {\n if (isOptionForCreate(group)) {\n const index = getIndex();\n return (\n <SelectCreateButton\n size={size}\n labelForCreate={labelForCreate}\n inputValue={group.label}\n indent={indent}\n ref={itemsRefs[index]}\n {...getOptionProps({\n index,\n item: group,\n keyPrefix: groupIndex,\n })}\n />\n );\n }\n\n const virtualIndex =\n visibleItems.length > 1 ? getVirtualIndex() : 0;\n\n return (\n <Fragment key={group.key}>\n {group.group &&\n getGroupLabel &&\n isVisible(slice, virtualIndex) && (\n <SelectGroupLabel\n label={getGroupLabel(group.group)}\n size={size}\n indent={indent}\n ref={listRefs[virtualIndex]}\n key={`group-${group.key}`}\n />\n )}\n {group.items.map((item, i) => {\n if (isOptionForSelectAll(item)) {\n const virtualIndex = getVirtualIndex();\n const index = getIndex();\n\n if (isVisible(slice, virtualIndex)) {\n return (\n <SelectItemAll\n ref={forkRef([\n listRefs[virtualIndex],\n itemsRefs[index],\n ])}\n indent={indent}\n size={size}\n {...getOptionProps({\n index,\n item,\n keyPrefix: i,\n })}\n intermediate={\n item.checkedCount && item.totalCount\n ? item.checkedCount !== item.totalCount\n : false\n }\n checked={item.checkedCount === item.totalCount}\n countItems={item.checkedCount}\n total={item.totalCount}\n />\n );\n }\n } else {\n const virtualIndex = getVirtualIndex();\n const index = getIndex();\n if (isVisible(slice, virtualIndex)) {\n return (\n <Fragment key={`${group.key}-${i}`}>\n {renderItem({\n ref: forkRef([\n listRefs[virtualIndex],\n itemsRefs[index],\n ]),\n item,\n ...getOptionProps({\n index,\n item,\n keyPrefix: i,\n }),\n })}\n </Fragment>\n );\n }\n }\n })}\n </Fragment>\n );\n })}\n {isLoading && isListShowed && (\n <ListLoader size={size} innerOffset={indent} />\n )}\n </div>\n {!isLoading && hasItems && notFound && labelForNotFound && (\n <ListItem\n size={size}\n label={labelForNotFound}\n innerOffset={indent}\n >\n {labelForNotFound}\n </ListItem>\n )}\n {!isLoading && !hasItems && labelForEmptyItems && (\n <ListItem\n size={size}\n label={labelForEmptyItems}\n innerOffset={indent}\n >\n {labelForEmptyItems}\n </ListItem>\n )}\n </div>\n </Popover>\n );\n }}\n </Transition>\n );\n};\n"],"mappings":"ylCAAA,6BAEA,MAAOA,MAAP,EAAgBC,QAAhB,CAA0BC,SAA1B,CAAqCC,OAArC,CAA8CC,MAA9C,KAA4D,OAA5D,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAEA,OACEC,SADF,CA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,CAAS,EAAIQ,CAAb,EACC,oBAAC,UAAD,EAAY,IAAI,CAAEvB,CAAlB,CAAwB,WAAW,CAAEsB,CAArC,EAhGJ,CAVF,CA6GG,CAACP,CAAD,EAAcP,CAAd,EAA0BS,CAA1B,EAAsCX,CAAtC,EACC,oBAAC,QAAD,EACE,IAAI,CAAEN,CADR,CAEE,KAAK,CAAEM,CAFT,CAGE,WAAW,CAAEgB,CAHf,EAKGhB,CALH,CA9GJ,CAsHG,CAACS,CAAD,EAAc,CAACP,CAAf,EAA2BD,CAA3B,EACC,oBAAC,QAAD,EACE,IAAI,CAAEP,CADR,CAEE,KAAK,CAAEO,CAFT,CAGE,WAAW,CAAEe,CAHf,EAKGf,CALH,CAvHJ,CApBF,CAsJH,CAjKH,CAoKH,CAjPM"}
|
|
1
|
+
{"version":3,"file":"SelectDropdown.js","names":["React","Fragment","useEffect","useMemo","useRef","Transition","cnListBox","ListItem","ListLoader","mapVerticalSpace","Popover","useDebounce","useFlag","forkRef","useForkRef","useVirtualScroll","animateTimeout","cnMixPopoverAnimate","cnMixScrollBar","cnMixSpace","cn","fabricIndex","SelectCreateButton","SelectGroupLabel","SelectItemAll","SelectLoader","isNotOptionForCreate","isOptionForCreate","isOptionForSelectAll","selectDropdownForm","defaultSelectDropdownPropForm","cnSelectDropdown","getLengthElements","elements","element","length","index","items","isVisible","slice","SelectDropdown","props","controlRef","size","getOptionProps","dropdownRefProp","dropdownRef","labelForCreate","className","labelForNotFound","labelForEmptyItems","hasItems","form","isOpen","offset","offsetProp","renderItem","visibleItems","isLoading","getGroupLabel","notFound","itemsRefs","virtualScroll","onScrollToBottom","otherProps","indent","isListShowed","filter","group","Array","isArray","lengthForVirtualScroll","isActive","spaceTop","sliceHookProp","listRefs","scrollElementRef","popoverRef","scrolled","setScrolled","setScrolledOffDebounce","off","fn","on","current","addEventListener","removeEventListener","animate","getIndex","getVirtualIndex","border","shadow","pV","marginTop","map","groupIndex","label","item","keyPrefix","virtualIndex","key","i","checkedCount","totalCount","ref"],"sources":["../../../../../../src/components/SelectComponents/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["import './SelectDropdown.css';\n\nimport React, { Fragment, useEffect, useMemo, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport {\n cnListBox,\n ListItem,\n ListLoader,\n mapVerticalSpace,\n} from '##/components/ListCanary';\nimport { Popover, PopoverPropOffset } from '##/components/Popover';\nimport { useDebounce } from '##/hooks/useDebounce';\nimport { useFlag } from '##/hooks/useFlag';\nimport { forkRef, useForkRef } from '##/hooks/useForkRef';\nimport { useVirtualScroll } from '##/hooks/useVirtualScroll';\nimport {\n animateTimeout,\n cnMixPopoverAnimate,\n} from '##/mixs/MixPopoverAnimate/MixPopoverAnimate';\nimport { cnMixScrollBar } from '##/mixs/MixScrollBar';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\nimport { fabricIndex } from '##/utils/fabricIndex';\nimport { SelectAllItem } from '##/utils/getGroups';\nimport { PropsWithJsxAttributes } from '##/utils/types/PropsWithJsxAttributes';\n\nimport { SelectCreateButton } from '../SelectCreateButton/SelectCreateButton';\nimport { SelectGroupLabel } from '../SelectGroupLabel/SelectGroupLabel';\nimport { SelectItemAll } from '../SelectItemAll/SelectItemAll';\nimport { SelectLoader } from '../SelectLoader/SelectLoader';\nimport { PropSize, RenderItemProps } from '../types';\nimport {\n GetOptionPropsResult,\n isNotOptionForCreate,\n isOptionForCreate,\n isOptionForSelectAll,\n OptionForCreate,\n OptionProps,\n} from '../useSelect';\n\nexport const selectDropdownForm = ['default', 'brick', 'round'] as const;\nexport type SelectDropdownPropForm = typeof selectDropdownForm[number];\nexport const defaultSelectDropdownPropForm = selectDropdownForm[0];\n\ntype Props<ITEM, GROUP> = PropsWithJsxAttributes<{\n size: PropSize;\n controlRef: React.MutableRefObject<HTMLDivElement | null>;\n dropdownRef: React.Ref<HTMLDivElement>;\n getOptionProps(props: OptionProps<ITEM>): GetOptionPropsResult;\n form: SelectDropdownPropForm;\n isOpen: boolean;\n offset?: PopoverPropOffset | 'none';\n isLoading?: boolean;\n renderItem: (props: RenderItemProps<ITEM>) => React.ReactNode | null;\n visibleItems: (\n | OptionForCreate\n | {\n items: Array<SelectAllItem | ITEM>;\n key: string | number;\n group?: GROUP;\n groupIndex: number;\n checkedCount?: number;\n totalCount?: number;\n }\n )[];\n getGroupLabel?: (group: GROUP) => string;\n labelForCreate?: string;\n labelForNotFound?: string;\n labelForEmptyItems?: string;\n notFound?: boolean;\n hasItems?: boolean;\n itemsRefs: React.RefObject<HTMLDivElement>[];\n virtualScroll?: boolean;\n onScrollToBottom?: (length: number) => void;\n}>;\n\ntype SelectDropdownComponent = <ITEM, GROUP>(\n props: Props<ITEM, GROUP>,\n) => React.ReactNode | null;\n\nconst cnSelectDropdown = cn('SelectDropdown');\n\nconst getLengthElements = <ITEM, GROUP>(\n elements: (\n | OptionForCreate\n | {\n items: Array<SelectAllItem | ITEM>;\n key: string | number;\n group?: GROUP;\n groupIndex: number;\n checkedCount?: number;\n totalCount?: number;\n }\n )[],\n) => {\n let length = elements.length <= 1 ? 0 : elements.length;\n\n for (let index = 0; index < elements.length; index++) {\n const element = elements[index];\n\n if (isNotOptionForCreate(element) && element.items.length) {\n length += element.items.length;\n }\n }\n\n return length;\n};\n\nconst isVisible = (slice: [number, number], index: number) => {\n return index >= slice[0] && index < slice[1];\n};\n\nexport const SelectDropdown: SelectDropdownComponent = (props) => {\n const {\n controlRef,\n size,\n getOptionProps,\n dropdownRef: dropdownRefProp,\n labelForCreate,\n className,\n labelForNotFound,\n labelForEmptyItems,\n hasItems = true,\n form,\n isOpen,\n offset: offsetProp = 'none',\n renderItem,\n visibleItems,\n isLoading,\n getGroupLabel,\n notFound,\n itemsRefs,\n virtualScroll,\n onScrollToBottom,\n ...otherProps\n } = props;\n\n const indent = form === 'round' ? 'increased' : 'normal';\n\n const isListShowed = useMemo(() => {\n return (\n visibleItems.filter(\n (group) =>\n isOptionForCreate(group) ||\n (Array.isArray(group.items) && group.items.length > 0),\n ).length > 0\n );\n }, [visibleItems]);\n\n const offset = offsetProp === 'none' ? undefined : offsetProp;\n\n const lengthForVirtualScroll = useMemo(\n () => getLengthElements(visibleItems),\n [visibleItems],\n );\n\n const {\n spaceTop,\n slice: sliceHookProp,\n listRefs,\n scrollElementRef,\n } = useVirtualScroll({\n length: lengthForVirtualScroll,\n isActive: virtualScroll && isOpen,\n onScrollToBottom,\n });\n\n const slice: [number, number] =\n sliceHookProp[0] === 0 && virtualScroll ? [0, 50] : sliceHookProp;\n\n const popoverRef = useRef<HTMLDivElement>(null);\n const dropdownRef = useForkRef([scrollElementRef, dropdownRefProp]);\n const [scrolled, setScrolled] = useFlag();\n const setScrolledOffDebounce = useDebounce(setScrolled.off, 100);\n\n useEffect(() => {\n const fn = () => {\n setScrolled.on();\n setScrolledOffDebounce();\n };\n\n scrollElementRef.current?.addEventListener('scroll', fn);\n\n return () => {\n scrollElementRef.current?.removeEventListener('scroll', fn);\n };\n }, [scrollElementRef.current]);\n\n return (\n <Transition\n in={isOpen}\n unmountOnExit\n nodeRef={popoverRef}\n timeout={animateTimeout}\n >\n {(animate) => {\n const getIndex = fabricIndex();\n const getVirtualIndex = fabricIndex();\n\n return (\n <Popover\n {...otherProps}\n anchorRef={controlRef}\n direction=\"downStartLeft\"\n possibleDirections={[\n 'downStartLeft',\n 'upStartLeft',\n 'downStartRight',\n 'upStartRight',\n ]}\n offset={offset}\n ref={popoverRef}\n role=\"listbox\"\n className={cnSelectDropdown(null, [\n cnListBox({ size, form, border: true, shadow: true }),\n cnMixPopoverAnimate({ animate }),\n className,\n ])}\n equalAnchorWidth\n >\n <div\n className={cnSelectDropdown('ScrollContainer', [\n cnMixSpace({\n pV: mapVerticalSpace[size],\n }),\n cnMixScrollBar(),\n ])}\n ref={dropdownRef}\n >\n {isLoading && !isListShowed && <SelectLoader />}\n <div\n className={cnSelectDropdown('List', { scrolled })}\n style={{ marginTop: spaceTop }}\n >\n {visibleItems.map((group, groupIndex) => {\n if (isOptionForCreate(group)) {\n const index = getIndex();\n return (\n <SelectCreateButton\n size={size}\n labelForCreate={labelForCreate}\n inputValue={group.label}\n indent={indent}\n ref={itemsRefs[index]}\n {...getOptionProps({\n index,\n item: group,\n keyPrefix: groupIndex,\n })}\n />\n );\n }\n\n const virtualIndex =\n visibleItems.length > 1 ? getVirtualIndex() : 0;\n\n return (\n <Fragment key={group.key}>\n {group.group &&\n getGroupLabel &&\n isVisible(slice, virtualIndex) && (\n <SelectGroupLabel\n label={getGroupLabel(group.group)}\n size={size}\n indent={indent}\n ref={listRefs[virtualIndex]}\n key={`group-${group.key}`}\n />\n )}\n {group.items.map((item, i) => {\n if (isOptionForSelectAll(item)) {\n const virtualIndex = getVirtualIndex();\n const index = getIndex();\n\n if (isVisible(slice, virtualIndex)) {\n return (\n <SelectItemAll\n ref={forkRef([\n listRefs[virtualIndex],\n itemsRefs[index],\n ])}\n indent={indent}\n size={size}\n {...getOptionProps({\n index,\n item,\n keyPrefix: i,\n })}\n intermediate={\n item.checkedCount && item.totalCount\n ? item.checkedCount !== item.totalCount\n : false\n }\n checked={item.checkedCount === item.totalCount}\n countItems={item.checkedCount}\n total={item.totalCount}\n />\n );\n }\n } else {\n const virtualIndex = getVirtualIndex();\n const index = getIndex();\n if (isVisible(slice, virtualIndex)) {\n return (\n <Fragment key={`${group.key}-${i}`}>\n {renderItem({\n ref: forkRef([\n listRefs[virtualIndex],\n itemsRefs[index],\n ]),\n item,\n ...getOptionProps({\n index,\n item,\n keyPrefix: i,\n }),\n })}\n </Fragment>\n );\n }\n }\n })}\n </Fragment>\n );\n })}\n {isLoading && isListShowed && (\n <ListLoader size={size} innerOffset={indent} />\n )}\n </div>\n {!isLoading && hasItems && notFound && labelForNotFound && (\n <ListItem\n size={size}\n label={labelForNotFound}\n innerOffset={indent}\n >\n {labelForNotFound}\n </ListItem>\n )}\n {!isLoading && !hasItems && labelForEmptyItems && (\n <ListItem\n size={size}\n label={labelForEmptyItems}\n innerOffset={indent}\n >\n {labelForEmptyItems}\n </ListItem>\n )}\n </div>\n </Popover>\n );\n }}\n </Transition>\n );\n};\n"],"mappings":"ylCAAA,6BAEA,MAAOA,MAAP,EAAgBC,QAAhB,CAA0BC,SAA1B,CAAqCC,OAArC,CAA8CC,MAA9C,KAA4D,OAA5D,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAEA,OACEC,SADF,CAEEC,QAFF,CAGEC,UAHF,CAIEC,gBAJF,wBAMA,OAASC,OAAT,qBACA,OAASC,WAAT,kCACA,OAASC,OAAT,8BACA,OAASC,OAAT,CAAkBC,UAAlB,iCACA,OAASC,gBAAT,uCACA,OACEC,cADF,CAEEC,mBAFF,yDAIA,OAASC,cAAT,kCACA,OAASC,UAAT,8BACA,OAASC,EAAT,0BACA,OAASC,WAAT,kCAIA,OAASC,kBAAT,gDACA,OAASC,gBAAT,4CACA,OAASC,aAAT,sCACA,OAASC,YAAT,oCAEA,OAEEC,oBAFF,CAGEC,iBAHF,CAIEC,oBAJF,oBASA,MAAO,IAAMC,mBAAkB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,OAArB,CAA3B,CAEP,MAAO,IAAMC,8BAA6B,CAAGD,kBAAkB,CAAC,CAAD,CAAxD,C,GAsCDE,iBAAgB,CAAGX,EAAE,CAAC,gBAAD,C,CAErBY,iBAAiB,CAAG,SACxBC,CADwB,CAYrB,CAGH,OACQC,EADR,CAFIC,CAAM,CAAsB,CAAnB,EAAAF,CAAQ,CAACE,MAAT,CAAuB,CAAvB,CAA2BF,CAAQ,CAACE,MAEjD,CAASC,CAAK,CAAG,CAAjB,CAAoBA,CAAK,CAAGH,CAAQ,CAACE,MAArC,CAA6CC,CAAK,EAAlD,CACQF,CADR,CACkBD,CAAQ,CAACG,CAAD,CAD1B,CAGMV,oBAAoB,CAACQ,CAAD,CAApB,EAAiCA,CAAO,CAACG,KAAR,CAAcF,MAHrD,GAIIA,CAAM,EAAID,CAAO,CAACG,KAAR,CAAc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wB,CAAD,CADG,CAEXtC,CAAS,CAACzB,CAAD,CAFE,CAAD,CADH,CAKT6D,IAAI,CAAJA,CALS,EAMNrD,CAAc,CAAC,CAChBR,KAAK,CAALA,CADgB,CAEhB6D,IAAI,CAAJA,CAFgB,CAGhBC,SAAS,CAAEG,CAHK,CAAD,CANR,EADb,CAgBL,CACF,CApDA,CAZH,CAmEH,CA1FA,CAJH,CA+FG3C,CAAS,EAAIQ,CAAb,EACC,oBAAC,UAAD,EAAY,IAAI,CAAEvB,CAAlB,CAAwB,WAAW,CAAEsB,CAArC,EAhGJ,CAVF,CA6GG,CAACP,CAAD,EAAcP,CAAd,EAA0BS,CAA1B,EAAsCX,CAAtC,EACC,oBAAC,QAAD,EACE,IAAI,CAAEN,CADR,CAEE,KAAK,CAAEM,CAFT,CAGE,WAAW,CAAEgB,CAHf,EAKGhB,CALH,CA9GJ,CAsHG,CAACS,CAAD,EAAc,CAACP,CAAf,EAA2BD,CAA3B,EACC,oBAAC,QAAD,EACE,IAAI,CAAEP,CADR,CAEE,KAAK,CAAEO,CAFT,CAGE,WAAW,CAAEe,CAHf,EAKGf,CALH,CAvHJ,CApBF,CAsJH,CAjKH,CAoKH,CAjPM"}
|
package/__internal__/src/components/SelectComponentsDeprecated/SelectContainer/SelectContainer.d.ts
CHANGED
|
@@ -17,4 +17,4 @@ export type SelectContainerProps = PropsWithHTMLAttributesAndRef<{
|
|
|
17
17
|
labelPosition?: 'top' | 'left';
|
|
18
18
|
caption?: string;
|
|
19
19
|
}, HTMLDivElement>;
|
|
20
|
-
export declare const SelectContainer: React.ForwardRefExoticComponent<
|
|
20
|
+
export declare const SelectContainer: React.ForwardRefExoticComponent<Omit<SelectContainerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
package/__internal__/src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ type Props<ITEM, GROUP> = PropsWithJsxAttributes<{
|
|
|
17
17
|
isOpen: boolean;
|
|
18
18
|
offset?: PopoverPropOffset | 'none';
|
|
19
19
|
isLoading?: boolean;
|
|
20
|
-
renderItem: (props: RenderItemProps<ITEM>) =>
|
|
20
|
+
renderItem: (props: RenderItemProps<ITEM>) => React.ReactNode | null;
|
|
21
21
|
visibleItems: (OptionForCreate | {
|
|
22
22
|
items: Array<SelectAllItem | ITEM>;
|
|
23
23
|
key: string | number;
|
|
@@ -33,6 +33,6 @@ type Props<ITEM, GROUP> = PropsWithJsxAttributes<{
|
|
|
33
33
|
notFound?: boolean;
|
|
34
34
|
hasItems?: boolean;
|
|
35
35
|
}>;
|
|
36
|
-
type SelectDropdown = <ITEM, GROUP>(props: Props<ITEM, GROUP>) => React.
|
|
36
|
+
type SelectDropdown = <ITEM, GROUP>(props: Props<ITEM, GROUP>) => React.ReactNode | null;
|
|
37
37
|
export declare const SelectDropdown: SelectDropdown;
|
|
38
38
|
export {};
|
package/__internal__/src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectDropdown.js","names":["React","Fragment","useMemo","useRef","Transition","cnListBox","ListItem","mapVerticalSpace","cnMixScrollBar","cnMixSpace","isOptionForCreate","isOptionForSelectAll","animateTimeout","cnMixPopoverAnimate","cnDeprecated","fabricIndex","Popover","SelectCreateButton","SelectGroupLabel","SelectItemAll","SelectLoader","selectDropdownForm","defaultSelectDropdownPropForm","cnSelectDropdown","SelectDropdown","props","controlRef","size","getOptionProps","dropdownRef","labelForCreate","className","labelForNotFound","labelForEmptyItems","hasItems","form","isOpen","offset","offsetProp","renderItem","visibleItems","isLoading","getGroupLabel","notFound","otherProps","indent","popoverRef","isListShowed","filter","group","Array","isArray","items","length","animate","getIndex","border","shadow","pV","map","label","index","item","key","i","checkedCount","totalCount"],"sources":["../../../../../../src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["import './SelectDropdown.css';\n\nimport React, { Fragment, useMemo, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport {\n cnListBox,\n ListItem,\n mapVerticalSpace,\n} from '##/components/ListCanary';\nimport { cnMixScrollBar } from '##/mixs/MixScrollBar';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { SelectAllItem } from '##/utils/getGroups';\n\nimport {\n GetOptionPropsResult,\n isOptionForCreate,\n isOptionForSelectAll,\n OptionForCreate,\n OptionProps,\n} from '../../../hooks/useSelect/useSelect';\nimport {\n animateTimeout,\n cnMixPopoverAnimate,\n} from '../../../mixs/MixPopoverAnimate/MixPopoverAnimate';\nimport { cnDeprecated } from '../../../utils/bem';\nimport { fabricIndex } from '../../../utils/fabricIndex';\nimport { PropsWithJsxAttributes } from '../../../utils/types/PropsWithJsxAttributes';\nimport { Popover, PopoverPropOffset } from '../../Popover/Popover';\nimport { SelectCreateButton } from '../SelectCreateButton/SelectCreateButton';\nimport { SelectGroupLabel } from '../SelectGroupLabel/SelectGroupLabel';\nimport { SelectItemAll } from '../SelectItemAll/SelectSelectAll';\nimport { SelectLoader } from '../SelectLoader/SelectLoader';\nimport { PropSize, RenderItemProps } from '../types';\n\nexport const selectDropdownForm = ['default', 'brick', 'round'] as const;\nexport type SelectDropdownPropForm = typeof selectDropdownForm[number];\nexport const defaultSelectDropdownPropForm = selectDropdownForm[0];\n\ntype Props<ITEM, GROUP> = PropsWithJsxAttributes<{\n size: PropSize;\n controlRef: React.MutableRefObject<HTMLDivElement | null>;\n dropdownRef: React.Ref<HTMLDivElement>;\n getOptionProps(props: OptionProps<ITEM>): GetOptionPropsResult;\n form: SelectDropdownPropForm;\n isOpen: boolean;\n offset?: PopoverPropOffset | 'none';\n isLoading?: boolean;\n renderItem: (props: RenderItemProps<ITEM>) => JSX.Element | null;\n visibleItems: (\n | OptionForCreate\n | {\n items: Array<SelectAllItem | ITEM>;\n key: string | number;\n group?: GROUP;\n groupIndex: number;\n checkedCount?: number;\n totalCount?: number;\n }\n )[];\n getGroupLabel?: (group: GROUP) => string;\n labelForCreate?: string;\n labelForNotFound?: string;\n labelForEmptyItems?: string;\n notFound?: boolean;\n hasItems?: boolean;\n}>;\n\ntype SelectDropdown = <ITEM, GROUP>(\n props: Props<ITEM, GROUP>,\n) => React.ReactElement | null;\n\nconst cnSelectDropdown = cnDeprecated('SelectDropdown');\n\nexport const SelectDropdown: SelectDropdown = (props) => {\n const {\n controlRef,\n size,\n getOptionProps,\n dropdownRef,\n labelForCreate,\n className,\n labelForNotFound,\n labelForEmptyItems,\n hasItems = true,\n form,\n isOpen,\n offset: offsetProp = 'none',\n renderItem,\n visibleItems,\n isLoading,\n getGroupLabel,\n notFound,\n ...otherProps\n } = props;\n\n const indent = form === 'round' ? 'increased' : 'normal';\n\n const popoverRef = useRef<HTMLDivElement>(null);\n\n const isListShowed = useMemo(() => {\n return (\n visibleItems.filter(\n (group) =>\n isOptionForCreate(group) ||\n (Array.isArray(group.items) && group.items.length > 0),\n ).length > 0\n );\n }, [visibleItems]);\n\n const offset = offsetProp === 'none' ? undefined : offsetProp;\n\n return (\n <Transition\n in={isOpen}\n unmountOnExit\n nodeRef={popoverRef}\n timeout={animateTimeout}\n >\n {(animate) => {\n const getIndex = fabricIndex();\n return (\n <Popover\n {...otherProps}\n anchorRef={controlRef}\n direction=\"downStartLeft\"\n possibleDirections={[\n 'downStartLeft',\n 'upStartLeft',\n 'downStartRight',\n 'upStartRight',\n ]}\n offset={offset}\n ref={popoverRef}\n role=\"listbox\"\n className={cnSelectDropdown(null, [\n cnListBox({ size, form, border: true, shadow: true }),\n cnMixPopoverAnimate({ animate }),\n className,\n ])}\n equalAnchorWidth\n >\n <div\n className={cnSelectDropdown('List', [\n cnMixSpace({\n pV: mapVerticalSpace[size],\n }),\n cnMixScrollBar(),\n ])}\n ref={dropdownRef}\n >\n {isLoading && (\n <SelectLoader mode={isListShowed ? 'blur' : 'empty'} />\n )}\n {visibleItems.map((group) => {\n if (isOptionForCreate(group)) {\n return (\n <SelectCreateButton\n size={size}\n labelForCreate={labelForCreate}\n inputValue={group.label}\n indent={indent}\n {...getOptionProps({ index: getIndex(), item: group })}\n />\n );\n }\n return (\n <Fragment key={group.key}>\n {group.group && getGroupLabel && (\n <SelectGroupLabel\n label={getGroupLabel(group.group)}\n size={size}\n indent={indent}\n />\n )}\n {group.items.map((item, i) => {\n if (isOptionForSelectAll(item)) {\n return (\n <SelectItemAll\n indent={indent}\n size={size}\n {...getOptionProps({ index: getIndex(), item })}\n intermediate={\n item.checkedCount && item.totalCount\n ? item.checkedCount !== item.totalCount\n : false\n }\n checked={item.checkedCount === item.totalCount}\n countItems={item.checkedCount}\n total={item.totalCount}\n />\n );\n }\n return (\n <Fragment key={`${group.key}-${i}`}>\n {renderItem({\n item,\n ...getOptionProps({ index: getIndex(), item }),\n })}\n </Fragment>\n );\n })}\n </Fragment>\n );\n })}\n {!isLoading && hasItems && notFound && labelForNotFound && (\n <ListItem\n size={size}\n label={labelForNotFound}\n innerOffset={indent}\n >\n {labelForNotFound}\n </ListItem>\n )}\n {!isLoading && !hasItems && labelForEmptyItems && (\n <ListItem\n size={size}\n label={labelForEmptyItems}\n innerOffset={indent}\n >\n {labelForEmptyItems}\n </ListItem>\n )}\n </div>\n </Popover>\n );\n }}\n </Transition>\n );\n};\n"],"mappings":"y+BAAA,6BAEA,MAAOA,MAAP,EAAgBC,QAAhB,CAA0BC,OAA1B,CAAmCC,MAAnC,KAAiD,OAAjD,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAEA,OACEC,SADF,CAEEC,QAFF,CAGEC,gBAHF,wBAKA,OAASC,cAAT,kCACA,OAASC,UAAT,8BAGA,OAEEC,iBAFF,CAGEC,oBAHF,0CAOA,OACEC,cADF,CAEEC,mBAFF,yDAIA,OAASC,YAAT,0BACA,OAASC,WAAT,kCAEA,OAASC,OAAT,6BACA,OAASC,kBAAT,gDACA,OAASC,gBAAT,4CACA,OAASC,aAAT,wCACA,OAASC,YAAT,oCAGA,MAAO,IAAMC,mBAAkB,CAAG,CA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GAAG,WAAKjB,CAAK,CAACc,GAAX,aAAkBC,CAAlB,CAAb,EACGzB,CAAU,gBACTuB,IAAI,CAAJA,CADS,EAENlC,CAAc,CAAC,CAAEiC,KAAK,CAAEN,CAAQ,EAAjB,CAAqBO,IAAI,CAAJA,CAArB,CAAD,CAFR,EADb,CAOH,CA1BA,CARH,CAqCH,CAlDA,CAZH,CA+DG,CAACrB,CAAD,EAAcP,CAAd,EAA0BS,CAA1B,EAAsCX,CAAtC,EACC,oBAAC,QAAD,EACE,IAAI,CAAEL,CADR,CAEE,KAAK,CAAEK,CAFT,CAGE,WAAW,CAAEa,CAHf,EAKGb,CALH,CAhEJ,CAwEG,CAACS,CAAD,EAAc,CAACP,CAAf,EAA2BD,CAA3B,EACC,oBAAC,QAAD,EACE,IAAI,CAAEN,CADR,CAEE,KAAK,CAAEM,CAFT,CAGE,WAAW,CAAEY,CAHf,EAKGZ,CALH,CAzEJ,CApBF,CAwGH,CAjHH,CAoHH,CA3JM"}
|
|
1
|
+
{"version":3,"file":"SelectDropdown.js","names":["React","Fragment","useMemo","useRef","Transition","cnListBox","ListItem","mapVerticalSpace","cnMixScrollBar","cnMixSpace","isOptionForCreate","isOptionForSelectAll","animateTimeout","cnMixPopoverAnimate","cnDeprecated","fabricIndex","Popover","SelectCreateButton","SelectGroupLabel","SelectItemAll","SelectLoader","selectDropdownForm","defaultSelectDropdownPropForm","cnSelectDropdown","SelectDropdown","props","controlRef","size","getOptionProps","dropdownRef","labelForCreate","className","labelForNotFound","labelForEmptyItems","hasItems","form","isOpen","offset","offsetProp","renderItem","visibleItems","isLoading","getGroupLabel","notFound","otherProps","indent","popoverRef","isListShowed","filter","group","Array","isArray","items","length","animate","getIndex","border","shadow","pV","map","label","index","item","key","i","checkedCount","totalCount"],"sources":["../../../../../../src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["import './SelectDropdown.css';\n\nimport React, { Fragment, useMemo, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport {\n cnListBox,\n ListItem,\n mapVerticalSpace,\n} from '##/components/ListCanary';\nimport { cnMixScrollBar } from '##/mixs/MixScrollBar';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { SelectAllItem } from '##/utils/getGroups';\n\nimport {\n GetOptionPropsResult,\n isOptionForCreate,\n isOptionForSelectAll,\n OptionForCreate,\n OptionProps,\n} from '../../../hooks/useSelect/useSelect';\nimport {\n animateTimeout,\n cnMixPopoverAnimate,\n} from '../../../mixs/MixPopoverAnimate/MixPopoverAnimate';\nimport { cnDeprecated } from '../../../utils/bem';\nimport { fabricIndex } from '../../../utils/fabricIndex';\nimport { PropsWithJsxAttributes } from '../../../utils/types/PropsWithJsxAttributes';\nimport { Popover, PopoverPropOffset } from '../../Popover/Popover';\nimport { SelectCreateButton } from '../SelectCreateButton/SelectCreateButton';\nimport { SelectGroupLabel } from '../SelectGroupLabel/SelectGroupLabel';\nimport { SelectItemAll } from '../SelectItemAll/SelectSelectAll';\nimport { SelectLoader } from '../SelectLoader/SelectLoader';\nimport { PropSize, RenderItemProps } from '../types';\n\nexport const selectDropdownForm = ['default', 'brick', 'round'] as const;\nexport type SelectDropdownPropForm = typeof selectDropdownForm[number];\nexport const defaultSelectDropdownPropForm = selectDropdownForm[0];\n\ntype Props<ITEM, GROUP> = PropsWithJsxAttributes<{\n size: PropSize;\n controlRef: React.MutableRefObject<HTMLDivElement | null>;\n dropdownRef: React.Ref<HTMLDivElement>;\n getOptionProps(props: OptionProps<ITEM>): GetOptionPropsResult;\n form: SelectDropdownPropForm;\n isOpen: boolean;\n offset?: PopoverPropOffset | 'none';\n isLoading?: boolean;\n renderItem: (props: RenderItemProps<ITEM>) => React.ReactNode | null;\n visibleItems: (\n | OptionForCreate\n | {\n items: Array<SelectAllItem | ITEM>;\n key: string | number;\n group?: GROUP;\n groupIndex: number;\n checkedCount?: number;\n totalCount?: number;\n }\n )[];\n getGroupLabel?: (group: GROUP) => string;\n labelForCreate?: string;\n labelForNotFound?: string;\n labelForEmptyItems?: string;\n notFound?: boolean;\n hasItems?: boolean;\n}>;\n\ntype SelectDropdown = <ITEM, GROUP>(\n props: Props<ITEM, GROUP>,\n) => React.ReactNode | null;\n\nconst cnSelectDropdown = cnDeprecated('SelectDropdown');\n\nexport const SelectDropdown: SelectDropdown = (props) => {\n const {\n controlRef,\n size,\n getOptionProps,\n dropdownRef,\n labelForCreate,\n className,\n labelForNotFound,\n labelForEmptyItems,\n hasItems = true,\n form,\n isOpen,\n offset: offsetProp = 'none',\n renderItem,\n visibleItems,\n isLoading,\n getGroupLabel,\n notFound,\n ...otherProps\n } = props;\n\n const indent = form === 'round' ? 'increased' : 'normal';\n\n const popoverRef = useRef<HTMLDivElement>(null);\n\n const isListShowed = useMemo(() => {\n return (\n visibleItems.filter(\n (group) =>\n isOptionForCreate(group) ||\n (Array.isArray(group.items) && group.items.length > 0),\n ).length > 0\n );\n }, [visibleItems]);\n\n const offset = offsetProp === 'none' ? undefined : offsetProp;\n\n return (\n <Transition\n in={isOpen}\n unmountOnExit\n nodeRef={popoverRef}\n timeout={animateTimeout}\n >\n {(animate) => {\n const getIndex = fabricIndex();\n return (\n <Popover\n {...otherProps}\n anchorRef={controlRef}\n direction=\"downStartLeft\"\n possibleDirections={[\n 'downStartLeft',\n 'upStartLeft',\n 'downStartRight',\n 'upStartRight',\n ]}\n offset={offset}\n ref={popoverRef}\n role=\"listbox\"\n className={cnSelectDropdown(null, [\n cnListBox({ size, form, border: true, shadow: true }),\n cnMixPopoverAnimate({ animate }),\n className,\n ])}\n equalAnchorWidth\n >\n <div\n className={cnSelectDropdown('List', [\n cnMixSpace({\n pV: mapVerticalSpace[size],\n }),\n cnMixScrollBar(),\n ])}\n ref={dropdownRef}\n >\n {isLoading && (\n <SelectLoader mode={isListShowed ? 'blur' : 'empty'} />\n )}\n {visibleItems.map((group) => {\n if (isOptionForCreate(group)) {\n return (\n <SelectCreateButton\n size={size}\n labelForCreate={labelForCreate}\n inputValue={group.label}\n indent={indent}\n {...getOptionProps({ index: getIndex(), item: group })}\n />\n );\n }\n return (\n <Fragment key={group.key}>\n {group.group && getGroupLabel && (\n <SelectGroupLabel\n label={getGroupLabel(group.group)}\n size={size}\n indent={indent}\n />\n )}\n {group.items.map((item, i) => {\n if (isOptionForSelectAll(item)) {\n return (\n <SelectItemAll\n indent={indent}\n size={size}\n {...getOptionProps({ index: getIndex(), item })}\n intermediate={\n item.checkedCount && item.totalCount\n ? item.checkedCount !== item.totalCount\n : false\n }\n checked={item.checkedCount === item.totalCount}\n countItems={item.checkedCount}\n total={item.totalCount}\n />\n );\n }\n return (\n <Fragment key={`${group.key}-${i}`}>\n {renderItem({\n item,\n ...getOptionProps({ index: getIndex(), item }),\n })}\n </Fragment>\n );\n })}\n </Fragment>\n );\n })}\n {!isLoading && hasItems && notFound && labelForNotFound && (\n <ListItem\n size={size}\n label={labelForNotFound}\n innerOffset={indent}\n >\n {labelForNotFound}\n </ListItem>\n )}\n {!isLoading && !hasItems && labelForEmptyItems && (\n <ListItem\n size={size}\n label={labelForEmptyItems}\n innerOffset={indent}\n >\n {labelForEmptyItems}\n </ListItem>\n )}\n </div>\n </Popover>\n );\n }}\n </Transition>\n );\n};\n"],"mappings":"y+BAAA,6BAEA,MAAOA,MAAP,EAAgBC,QAAhB,CAA0BC,OAA1B,CAAmCC,MAAnC,KAAiD,OAAjD,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAEA,OACEC,SADF,CAEEC,QAFF,CAGEC,gBAHF,wBAKA,OAASC,cAAT,kCACA,OAASC,UAAT,8BAGA,OAEEC,iBAFF,CAGEC,oBAHF,0CAOA,OACEC,cADF,CAEEC,mBAFF,yDAIA,OAASC,YAAT,0BACA,OAASC,WAAT,kCAEA,OAASC,OAAT,6BACA,OAASC,kBAAT,gDACA,OAASC,gBAAT,4CACA,OAASC,aAAT,wCACA,OAASC,YAAT,oCAGA,MAAO,IAAMC,mBAAkB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,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X,aAAkBC,CAAlB,CAAb,EACGzB,CAAU,gBACTuB,IAAI,CAAJA,CADS,EAENlC,CAAc,CAAC,CAAEiC,KAAK,CAAEN,CAAQ,EAAjB,CAAqBO,IAAI,CAAJA,CAArB,CAAD,CAFR,EADb,CAOH,CA1BA,CARH,CAqCH,CAlDA,CAZH,CA+DG,CAACrB,CAAD,EAAcP,CAAd,EAA0BS,CAA1B,EAAsCX,CAAtC,EACC,oBAAC,QAAD,EACE,IAAI,CAAEL,CADR,CAEE,KAAK,CAAEK,CAFT,CAGE,WAAW,CAAEa,CAHf,EAKGb,CALH,CAhEJ,CAwEG,CAACS,CAAD,EAAc,CAACP,CAAf,EAA2BD,CAA3B,EACC,oBAAC,QAAD,EACE,IAAI,CAAEN,CADR,CAEE,KAAK,CAAEM,CAFT,CAGE,WAAW,CAAEY,CAHf,EAKGZ,CALH,CAzEJ,CApBF,CAwGH,CAjHH,CAoHH,CA3JM"}
|
package/__internal__/src/components/SelectComponentsDeprecated/SelectItemAll/SelectSelectAll.d.ts
CHANGED
|
@@ -10,4 +10,4 @@ export type SelectItemAllProps = PropsWithHTMLAttributes<{
|
|
|
10
10
|
total?: number;
|
|
11
11
|
}, HTMLDivElement>;
|
|
12
12
|
export declare const cnSelectItemAll: import("@bem-react/classname").ClassNameFormatter;
|
|
13
|
-
export declare const SelectItemAll: (props: SelectItemAllProps) => JSX.Element;
|
|
13
|
+
export declare const SelectItemAll: (props: SelectItemAllProps) => import("react/jsx-runtime").JSX.Element;
|
package/__internal__/src/components/SelectComponentsDeprecated/SelectLoader/SelectLoader.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ type Props = {
|
|
|
5
5
|
size?: PropSize;
|
|
6
6
|
};
|
|
7
7
|
export declare const cnSelectLoader: import("@bem-react/classname").ClassNameFormatter;
|
|
8
|
-
export declare const SelectLoader: (props: Props) => JSX.Element;
|
|
8
|
+
export declare const SelectLoader: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -22,8 +22,8 @@ export type PropGetItemGroupKey<ITEM> = (item: ITEM) => string | number | undefi
|
|
|
22
22
|
export type PropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;
|
|
23
23
|
export type PropGetGroupKey<GROUP> = (group: GROUP) => string | number;
|
|
24
24
|
export type PropGetGroupLabel<GROUP> = (group: GROUP) => string;
|
|
25
|
-
export type PropRenderItem<ITEM> = (props: RenderItemProps<ITEM>) => React.
|
|
26
|
-
export type PropRenderValue<ITEM> = (props: RenderValueProps<ITEM>) => React.
|
|
25
|
+
export type PropRenderItem<ITEM> = (props: RenderItemProps<ITEM>) => React.ReactNode | null;
|
|
26
|
+
export type PropRenderValue<ITEM> = (props: RenderValueProps<ITEM>) => React.ReactNode | null;
|
|
27
27
|
export type SelectProps<ITEM = DefaultItem, GROUP = DefaultGroup> = PropsWithHTMLAttributesAndRef<{
|
|
28
28
|
items: ITEM[];
|
|
29
29
|
onChange: (props: {
|
|
@@ -80,7 +80,7 @@ export type SelectProps<ITEM = DefaultItem, GROUP = DefaultGroup> = PropsWithHTM
|
|
|
80
80
|
} ? {} : {
|
|
81
81
|
getGroupKey: PropGetGroupKey<GROUP>;
|
|
82
82
|
});
|
|
83
|
-
export type SelectComponent = <ITEM = DefaultItem, GROUP = DefaultGroup>(props: SelectProps<ITEM, GROUP>) => React.
|
|
83
|
+
export type SelectComponent = <ITEM = DefaultItem, GROUP = DefaultGroup>(props: SelectProps<ITEM, GROUP>) => React.ReactNode | null;
|
|
84
84
|
export declare const defaultGetItemKey: PropGetItemKey<DefaultItem>;
|
|
85
85
|
export declare const defaultGetItemLabel: PropGetItemLabel<DefaultItem>;
|
|
86
86
|
export declare const defaultGetItemGroupKey: PropGetItemGroupKey<DefaultItem>;
|
|
@@ -126,7 +126,7 @@ export declare function withDefaultGetters<ITEM, GROUP>(props: SelectProps<ITEM,
|
|
|
126
126
|
labelIcon?: IconComponent;
|
|
127
127
|
labelPosition?: "top" | "left";
|
|
128
128
|
caption?: string;
|
|
129
|
-
} & Omit<React.HTMLAttributes<HTMLDivElement>, "css" | "
|
|
129
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, "css" | "onFocus" | "onBlur" | "onChange" | "size" | "view" | "form" | "status" | "caption" | "label" | "name" | "disabled" | "value" | "multiple" | "placeholder" | "required" | "inputRef" | "items" | "dropdownForm" | "focused" | "ariaLabel" | "dropdownClassName" | "dropdownRef" | "isLoading" | "labelForEmptyItems" | "renderItem" | "renderValue" | "groups" | "getItemLabel" | "getItemKey" | "getItemGroupKey" | "getItemDisabled" | "getGroupLabel" | "getGroupKey" | "labelIcon" | "labelPosition"> & React.RefAttributes<HTMLDivElement> & (ITEM extends {
|
|
130
130
|
label: DefaultItem["label"];
|
|
131
131
|
} ? {} : {
|
|
132
132
|
getItemLabel: PropGetItemLabel<ITEM>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","names":["defaultGetItemKey","item","id","defaultGetItemLabel","label","defaultGetItemGroupKey","groupId","defaultGetItemDisabled","disabled","defaultGetGroupKey","group","defaultGetGroupLabel","withDefaultGetters","props","getItemLabel","getItemKey","getItemGroupKey","getItemDisabled","getGroupLabel","getGroupKey","iconSizeMap","xs","s","m","l"],"sources":["../../../../../src/components/SelectDeprecated/helpers.ts"],"sourcesContent":["import { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\nimport {\n PropForm,\n PropSize,\n PropStatus,\n PropView,\n RenderItemProps,\n} from '../SelectComponentsDeprecated/types';\n\nexport type DefaultItem = {\n label: string;\n id: string | number;\n groupId?: string | number;\n disabled?: boolean;\n};\n\nexport type DefaultGroup = {\n label: string;\n id: string | number;\n};\n\ntype PropValue<ITEM> = ITEM | null | undefined;\n\ntype RenderValueProps<ITEM> = {\n item: ITEM;\n};\n\nexport type PropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type PropGetItemKey<ITEM> = (item: ITEM) => string | number;\nexport type PropGetItemGroupKey<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\nexport type PropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;\nexport type PropGetGroupKey<GROUP> = (group: GROUP) => string | number;\nexport type PropGetGroupLabel<GROUP> = (group: GROUP) => string;\nexport type PropRenderItem<ITEM> = (\n props: RenderItemProps<ITEM>,\n) => React.
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["defaultGetItemKey","item","id","defaultGetItemLabel","label","defaultGetItemGroupKey","groupId","defaultGetItemDisabled","disabled","defaultGetGroupKey","group","defaultGetGroupLabel","withDefaultGetters","props","getItemLabel","getItemKey","getItemGroupKey","getItemDisabled","getGroupLabel","getGroupKey","iconSizeMap","xs","s","m","l"],"sources":["../../../../../src/components/SelectDeprecated/helpers.ts"],"sourcesContent":["import { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\nimport {\n PropForm,\n PropSize,\n PropStatus,\n PropView,\n RenderItemProps,\n} from '../SelectComponentsDeprecated/types';\n\nexport type DefaultItem = {\n label: string;\n id: string | number;\n groupId?: string | number;\n disabled?: boolean;\n};\n\nexport type DefaultGroup = {\n label: string;\n id: string | number;\n};\n\ntype PropValue<ITEM> = ITEM | null | undefined;\n\ntype RenderValueProps<ITEM> = {\n item: ITEM;\n};\n\nexport type PropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type PropGetItemKey<ITEM> = (item: ITEM) => string | number;\nexport type PropGetItemGroupKey<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\nexport type PropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;\nexport type PropGetGroupKey<GROUP> = (group: GROUP) => string | number;\nexport type PropGetGroupLabel<GROUP> = (group: GROUP) => string;\nexport type PropRenderItem<ITEM> = (\n props: RenderItemProps<ITEM>,\n) => React.ReactNode | null;\nexport type PropRenderValue<ITEM> = (\n props: RenderValueProps<ITEM>,\n) => React.ReactNode | null;\n\nexport type SelectProps<\n ITEM = DefaultItem,\n GROUP = DefaultGroup,\n> = PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n onChange: (props: { value: ITEM | null; e: React.SyntheticEvent }) => void;\n disabled?: boolean;\n form?: PropForm;\n dropdownForm?: 'default' | 'brick' | 'round';\n size?: PropSize;\n view?: PropView;\n status?: PropStatus;\n focused?: boolean;\n multiple?: boolean;\n placeholder?: string;\n ariaLabel?: string;\n dropdownClassName?: string;\n dropdownRef?: React.RefObject<HTMLDivElement>;\n required?: boolean;\n name?: string;\n isLoading?: boolean;\n labelForEmptyItems?: string;\n value?: PropValue<ITEM>;\n renderItem?: PropRenderItem<ITEM>;\n renderValue?: PropRenderValue<ITEM>;\n onFocus?: React.FocusEventHandler<HTMLInputElement>;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n inputRef?: React.RefObject<HTMLInputElement>;\n groups?: GROUP[];\n getItemLabel?: PropGetItemLabel<ITEM>;\n getItemKey?: PropGetItemKey<ITEM>;\n getItemGroupKey?: PropGetItemGroupKey<ITEM>;\n getItemDisabled?: PropGetItemDisabled<ITEM>;\n getGroupLabel?: PropGetGroupLabel<GROUP>;\n getGroupKey?: PropGetGroupKey<GROUP>;\n label?: string;\n labelIcon?: IconComponent;\n labelPosition?: 'top' | 'left';\n caption?: string;\n },\n HTMLDivElement\n> &\n (ITEM extends { label: DefaultItem['label'] }\n ? {}\n : { getItemLabel: PropGetItemLabel<ITEM> }) &\n (ITEM extends { id: DefaultItem['id'] }\n ? {}\n : { getItemKey: PropGetItemKey<ITEM> }) &\n (GROUP extends { label: DefaultGroup['label'] }\n ? {}\n : { getGroupLabel: PropGetGroupLabel<GROUP> }) &\n (GROUP extends { id: DefaultGroup['id'] }\n ? {}\n : { getGroupKey: PropGetGroupKey<GROUP> });\n\nexport type SelectComponent = <ITEM = DefaultItem, GROUP = DefaultGroup>(\n props: SelectProps<ITEM, GROUP>,\n) => React.ReactNode | null;\n\nexport const defaultGetItemKey: PropGetItemKey<DefaultItem> = (item) => item.id;\nexport const defaultGetItemLabel: PropGetItemLabel<DefaultItem> = (item) =>\n item.label;\nexport const defaultGetItemGroupKey: PropGetItemGroupKey<DefaultItem> = (\n item,\n) => item.groupId;\nexport const defaultGetItemDisabled: PropGetItemDisabled<DefaultItem> = (\n item,\n) => item.disabled;\n\nexport const defaultGetGroupKey: PropGetGroupKey<DefaultGroup> = (group) =>\n group.id;\nexport const defaultGetGroupLabel: PropGetGroupLabel<DefaultGroup> = (group) =>\n group.label;\n\nexport function withDefaultGetters<ITEM, GROUP>(\n props: SelectProps<ITEM, GROUP>,\n) {\n return {\n ...props,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemKey: props.getItemKey || defaultGetItemKey,\n getItemGroupKey: props.getItemGroupKey || defaultGetItemGroupKey,\n getItemDisabled: props.getItemDisabled || defaultGetItemDisabled,\n getGroupLabel: props.getGroupLabel || defaultGetGroupLabel,\n getGroupKey: props.getGroupKey || defaultGetGroupKey,\n };\n}\n\nexport const iconSizeMap: Record<PropSize, IconPropSize> = {\n xs: 'xs',\n s: 's',\n m: 'm',\n l: 'm',\n};\n"],"mappings":"qqBAyGA,MAAO,IAAMA,kBAA8C,CAAG,SAACC,CAAD,QAAUA,EAAI,CAACC,EAAf,CAAvD,CACP,MAAO,IAAMC,oBAAkD,CAAG,SAACF,CAAD,QAChEA,EAAI,CAACG,KAD2D,CAA3D,CAEP,MAAO,IAAMC,uBAAwD,CAAG,SACtEJ,CADsE,QAEnEA,EAAI,CAACK,OAF8D,CAAjE,CAGP,MAAO,IAAMC,uBAAwD,CAAG,SACtEN,CADsE,QAEnEA,EAAI,CAACO,QAF8D,CAAjE,CAIP,MAAO,IAAMC,mBAAiD,CAAG,SAACC,CAAD,QAC/DA,EAAK,CAACR,EADyD,CAA1D,CAEP,MAAO,IAAMS,qBAAqD,CAAG,SAACD,CAAD,QACnEA,EAAK,CAACN,KAD6D,CAA9D,CAGP,MAAO,SAASQ,mBAAT,CACLC,CADK,CAEL,CACA,sCACKA,CADL,MAEEC,YAAY,CAAED,CAAK,CAACC,YAAN,EAAsBX,mBAFtC,CAGEY,UAAU,CAAEF,CAAK,CAACE,UAAN,EAAoBf,iBAHlC,CAIEgB,eAAe,CAAEH,CAAK,CAACG,eAAN,EAAyBX,sBAJ5C,CAKEY,eAAe,CAAEJ,CAAK,CAACI,eAAN,EAAyBV,sBAL5C,CAMEW,aAAa,CAAEL,CAAK,CAACK,aAAN,EAAuBP,oBANxC,CAOEQ,WAAW,CAAEN,CAAK,CAACM,WAAN,EAAqBV,kBAPpC,EASD,CAED,MAAO,IAAMW,YAA2C,CAAG,CACzDC,EAAE,CAAE,IADqD,CAEzDC,CAAC,CAAE,GAFsD,CAGzDC,CAAC,CAAE,GAHsD,CAIzDC,CAAC,CAAE,GAJsD,CAApD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","children"],_excluded2=["className","children"],_excluded3=["isOpen","onClose","onOpen","hasOverlay","onClickOutside","onEsc","position","size","className","children","container","style","rootClassName","afterClose"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"./Sidebar.css";import React,{useEffect,useRef}from"react";import{Transition}from"react-transition-group";import{PortalWithTheme,PortalWithThemeConsumer}from"../PortalWithTheme";import{useTheme}from"../Theme/Theme";import{useGlobalKeys}from"../../hooks/useGlobalKeys";import{cnMixScrollBar}from"../../mixs/MixScrollBar";import{cn}from"../../utils/bem";var sidebarPropPosition=["right","bottom","left","top"],sidebarPropPositionDefault=sidebarPropPosition[0];export var sidebarPropSize=["s","m","l","full","1/2","1/3","1/4","2/3","3/4"];var sidebarPropSizeDefault=sidebarPropSize[1];export var cnSidebar=cn("Sidebar");var SidebarContent=function(a){var b=a.className,c=a.children,d=_objectWithoutProperties(a,_excluded);return React.createElement("div",Object.assign({className:cnSidebar("Content",[b,cnMixScrollBar()])},d),c)},SidebarActions=function(a){var b=a.className,c=a.children,d=_objectWithoutProperties(a,_excluded2);return React.createElement("div",Object.assign({className:cnSidebar("Actions",[b])},d),c)};export var Sidebar=function(a){var b=a.isOpen,c=a.onClose,d=a.onOpen,e=a.hasOverlay,f=void 0===e||e,g=a.onClickOutside,h=a.onEsc,i=a.position,j=void 0===i?sidebarPropPositionDefault:i,k=a.size,l=void 0===k?sidebarPropSizeDefault:k,m=a.className,n=a.children,o=a.container,p=void 0===o?window.document.body:o,q=a.style,r=a.rootClassName,s=a.afterClose,t=_objectWithoutProperties(a,_excluded3),u=useRef(null),v=useRef(null),w=useTheme(),x=w.theme;return useEffect(function(){b?null===d||void 0===d?void 0:d():null===c||void 0===c?void 0:c()},[b]),useGlobalKeys({Escape:function Escape(a){return b&&h&&h(a)}}),React.createElement(Transition,{in:b,unmountOnExit:!0,timeout:240,nodeRef:v,onExiting:s},function(a){return React.createElement(PortalWithTheme,{preset:x,ref:v,container:p,className:cnSidebar({position:j,hasOverlay:f},[r]),style:"number"==typeof(null===q||void 0===q?void 0:q.zIndex)?{zIndex:q.zIndex}:void 0},f&&React.createElement("div",{className:cnSidebar("Overlay",{animate:a}),"aria-label":"Overlay"}),React.createElement("div",Object.assign({},t,{style:_objectSpread(_objectSpread({},q),{},{zIndex:void 0}),className:cnSidebar("Window",{size:l,position:j,animate:a},[m]),ref:u}),React.createElement(PortalWithThemeConsumer,{onClickOutside:g,ignoreClicksInsideRefs:[u]},n)))})};Sidebar.Content=SidebarContent,Sidebar.Actions=SidebarActions;
|
|
2
2
|
//# sourceMappingURL=Sidebar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.js","names":["React","useEffect","useRef","Transition","PortalWithTheme","
|
|
1
|
+
{"version":3,"file":"Sidebar.js","names":["React","useEffect","useRef","Transition","PortalWithTheme","PortalWithThemeConsumer","useTheme","useGlobalKeys","cnMixScrollBar","cn","sidebarPropPosition","sidebarPropPositionDefault","sidebarPropSize","sidebarPropSizeDefault","cnSidebar","SidebarContent","className","children","rest","SidebarActions","Sidebar","props","isOpen","onClose","onOpen","hasOverlay","onClickOutside","onEsc","position","size","container","window","document","body","style","rootClassName","afterClose","otherProps","ref","portalRef","theme","Escape","e","animate","zIndex","Content","Actions"],"sources":["../../../../../src/components/Sidebar/Sidebar.tsx"],"sourcesContent":["import './Sidebar.css';\n\nimport React, { useEffect, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport {\n PortalWithTheme,\n PortalWithThemeConsumer,\n} from '##/components/PortalWithTheme';\nimport { useTheme } from '##/components/Theme/Theme';\nimport { useGlobalKeys } from '##/hooks/useGlobalKeys';\nimport { cnMixScrollBar } from '##/mixs/MixScrollBar';\nimport { cn } from '##/utils/bem';\nimport { AsTagAttribute } from '##/utils/types/AsTags';\nimport { PropsWithHTMLAttributes } from '##/utils/types/PropsWithHTMLAttributes';\n\nconst sidebarPropPosition = ['right', 'bottom', 'left', 'top'] as const;\ntype SidebarPropPosition = typeof sidebarPropPosition[number];\nconst sidebarPropPositionDefault: SidebarPropPosition = sidebarPropPosition[0];\n\nexport const sidebarPropSize = [\n 's',\n 'm',\n 'l',\n 'full',\n '1/2',\n '1/3',\n '1/4',\n '2/3',\n '3/4',\n] as const;\n\nexport type SidebarPropSize = typeof sidebarPropSize[number];\nconst sidebarPropSizeDefault: SidebarPropSize = sidebarPropSize[1];\n\ntype SidebarProps = PropsWithHTMLAttributes<\n {\n isOpen?: boolean;\n onClose?: () => void;\n onOpen?: () => void;\n hasOverlay?: boolean;\n onClickOutside?: (event: MouseEvent) => void;\n onEsc?: (event: KeyboardEvent) => void;\n position?: SidebarPropPosition;\n size?: SidebarPropSize;\n rootClassName?: string;\n children?: React.ReactNode;\n container?: HTMLDivElement | undefined;\n afterClose?: () => void;\n },\n HTMLDivElement\n>;\n\ntype SidebarContentProps = {\n className?: string;\n children: React.ReactNode;\n};\n\ntype SidebarActionsProps = {\n className?: string;\n children: React.ReactNode;\n};\n\nexport const cnSidebar = cn('Sidebar');\n\nconst SidebarContent: React.FC<SidebarContentProps> = ({\n className,\n children,\n ...rest\n}) => (\n <div\n className={cnSidebar('Content', [className, cnMixScrollBar()])}\n {...rest}\n >\n {children}\n </div>\n);\n\nconst SidebarActions: React.FC<SidebarActionsProps> = ({\n className,\n children,\n ...rest\n}) => (\n <div className={cnSidebar('Actions', [className])} {...rest}>\n {children}\n </div>\n);\n\ninterface SidebarComponent\n extends React.FC<SidebarProps>,\n AsTagAttribute<'div'> {\n Content: typeof SidebarContent;\n Actions: typeof SidebarActions;\n}\n\nexport const Sidebar: SidebarComponent = (props) => {\n const {\n isOpen,\n onClose,\n onOpen,\n hasOverlay = true,\n onClickOutside,\n onEsc,\n position = sidebarPropPositionDefault,\n size = sidebarPropSizeDefault,\n className,\n children,\n container = window.document.body,\n style,\n rootClassName,\n afterClose,\n ...otherProps\n } = props;\n\n const ref = useRef<HTMLDivElement | null>(null);\n\n const portalRef = useRef<HTMLDivElement>(null);\n\n const { theme } = useTheme();\n\n useEffect(() => {\n if (isOpen) {\n onOpen?.();\n } else {\n onClose?.();\n }\n }, [isOpen]);\n\n useGlobalKeys({\n Escape: (e) => isOpen && onEsc && onEsc(e),\n });\n\n return (\n <Transition\n in={isOpen}\n unmountOnExit\n timeout={240}\n nodeRef={portalRef}\n onExiting={afterClose}\n >\n {(animate) => (\n <PortalWithTheme\n preset={theme}\n ref={portalRef}\n container={container}\n className={cnSidebar({ position, hasOverlay }, [rootClassName])}\n style={\n typeof style?.zIndex === 'number'\n ? { zIndex: style.zIndex }\n : undefined\n }\n >\n {hasOverlay && (\n <div\n className={cnSidebar('Overlay', { animate })}\n aria-label=\"Overlay\"\n />\n )}\n <div\n {...otherProps}\n style={{\n ...style,\n zIndex: undefined,\n }}\n className={cnSidebar('Window', { size, position, animate }, [\n className,\n ])}\n ref={ref}\n >\n <PortalWithThemeConsumer\n onClickOutside={onClickOutside}\n ignoreClicksInsideRefs={[ref]}\n >\n {children}\n </PortalWithThemeConsumer>\n </div>\n </PortalWithTheme>\n )}\n </Transition>\n );\n};\n\nSidebar.Content = SidebarContent;\nSidebar.Actions = SidebarActions;\n"],"mappings":"8+BAAA,sBAEA,MAAOA,MAAP,EAAgBC,SAAhB,CAA2BC,MAA3B,KAAyC,OAAzC,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAEA,OACEC,eADF,CAEEC,uBAFF,0BAIA,OAASC,QAAT,sBACA,OAASC,aAAT,iCACA,OAASC,cAAT,+BACA,OAASC,EAAT,uB,GAIMC,oBAAmB,CAAG,CAAC,OAAD,CAAU,QAAV,CAAoB,MAApB,CAA4B,KAA5B,C,CAEtBC,0BAA+C,CAAGD,mBAAmB,CAAC,CAAD,C,CAE3E,MAAO,IAAME,gBAAe,CAAG,CAC7B,GAD6B,CAE7B,GAF6B,CAG7B,GAH6B,CAI7B,MAJ6B,CAK7B,KAL6B,CAM7B,KAN6B,CAO7B,KAP6B,CAQ7B,KAR6B,CAS7B,KAT6B,CAAxB,CAaP,GAAMC,uBAAuC,CAAGD,eAAe,CAAC,CAAD,CAA/D,CA8BA,MAAO,IAAME,UAAS,CAAGL,EAAE,CAAC,SAAD,CAApB,C,GAEDM,eAA6C,CAAG,eACpDC,EADoD,GACpDA,SADoD,CAEpDC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AQD,QAAQ,CAARA,CAAR,CAAkBe,OAAO,CAAPA,CAAlB,CAAX,CAAwC,CAC1D3B,CAD0D,CAAxC,CANtB,CASE,GAAG,CAAEsB,CATP,GAWE,oBAAC,uBAAD,EACE,cAAc,CAAEZ,CADlB,CAEE,sBAAsB,CAAE,CAACY,CAAD,CAF1B,EAIGrB,CAJH,CAXF,CAjBF,CADD,CAPH,CA+CH,CArFM,CAuFPG,OAAO,CAACyB,OAAR,CAAkB9B,c,CAClBK,OAAO,CAAC0B,OAAR,CAAkB3B,c"}
|
|
@@ -4,5 +4,5 @@ type SkeletonBrickProps = PropsWithHTMLAttributes<{
|
|
|
4
4
|
width?: CSSProperties['width'];
|
|
5
5
|
height: CSSProperties['height'];
|
|
6
6
|
}, HTMLDivElement>;
|
|
7
|
-
export declare const SkeletonBrick: ({ className, width, height, style, ...otherProps }: SkeletonBrickProps) => JSX.Element;
|
|
7
|
+
export declare const SkeletonBrick: ({ className, width, height, style, ...otherProps }: SkeletonBrickProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -4,5 +4,5 @@ import { PropsWithHTMLAttributes } from '../../../utils/types/PropsWithHTMLAttri
|
|
|
4
4
|
type SkeletonCircleProps = PropsWithHTMLAttributes<{
|
|
5
5
|
size: CSSProperties['width'] & CSSProperties['height'];
|
|
6
6
|
}, HTMLDivElement>;
|
|
7
|
-
export declare const SkeletonCircle: ({ className, size, style, ...otherProps }: SkeletonCircleProps) => JSX.Element;
|
|
7
|
+
export declare const SkeletonCircle: ({ className, size, style, ...otherProps }: SkeletonCircleProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -11,5 +11,5 @@ type Props = Omit<TextFieldProps<'number'>, 'value' | 'onChange' | 'min' | 'max'
|
|
|
11
11
|
value: number;
|
|
12
12
|
}) => void;
|
|
13
13
|
};
|
|
14
|
-
export declare const SliderInput: (props: Props) => JSX.Element;
|
|
14
|
+
export declare const SliderInput: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export {};
|
|
@@ -72,7 +72,7 @@ export type SliderPointProps = PropsWithHTMLAttributes<{
|
|
|
72
72
|
tooltipPossibleDirections?: Direction[];
|
|
73
73
|
}, HTMLButtonElement>;
|
|
74
74
|
export type SliderProps<RANGE extends boolean> = PropsWithHTMLAttributes<Props<RANGE>, HTMLDivElement>;
|
|
75
|
-
export type SliderComponent = <RANGE extends boolean = false>(props: SliderProps<RANGE>) => React.
|
|
75
|
+
export type SliderComponent = <RANGE extends boolean = false>(props: SliderProps<RANGE>) => React.ReactNode | null;
|
|
76
76
|
export declare const isRangeParams: (params: Props<boolean>) => params is Props<true>;
|
|
77
77
|
export declare const isNotRangeParams: (params: Props<boolean>) => params is Props<false>;
|
|
78
78
|
export declare const defaultTooltipFormatter: SliderPropTooltipFormatter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","names":["sliderPropStatus","sliderPropStatusDefault","sliderPropSize","sliderPropSizeDefault","isRangeParams","params","range","isNotRangeParams","defaultTooltipFormatter","value","toString","getValueForInput","props","field","getOnChangeForInput","e","onChange","newValue","getIcon","side","getMaxForStartField","max","getMinForEndField","min","getValidStep","step","Array","isArray","Math","abs"],"sources":["../../../../../src/components/Slider/helper.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';\nimport { Direction } from '../Popover';\nimport { ActiveButton } from './useSlider/helper';\n\nexport const sliderPropStatus = ['alert', 'warning', 'success'] as const;\nexport type SliderPropStatus = typeof sliderPropStatus[number];\nexport const sliderPropStatusDefault = sliderPropStatus[0];\n\nexport type SliderPropView = 'default' | 'division';\n\nexport const sliderPropSize = ['s', 'xs', 'm', 'l'] as const;\nexport type SliderPropSize = typeof sliderPropSize[number];\nexport const sliderPropSizeDefault: SliderPropSize = sliderPropSize[0];\n\nexport type SliderValue<RANGE> = RANGE extends true ? [number, number] : number;\n\nexport type SliderPropOnChange<RANGE> = (\n value: SliderValue<RANGE>,\n prop: {\n e?:\n | Event\n | React.TouchEvent\n | React.MouseEvent\n | React.KeyboardEvent\n | React.ChangeEvent;\n },\n) => void;\n\ntype SliderPropTooltipFormatter = (value: number | undefined) => string;\n\ntype Side = IconComponent | 'input';\n\ntype Props<RANGE extends boolean = false> = {\n className?: string;\n step?: number | number[];\n view?: SliderPropView;\n disabled?: boolean;\n range?: RANGE;\n withTooltip?: boolean;\n value: SliderValue<RANGE>;\n label?: string;\n labelIcon?: IconComponent;\n caption?: string;\n status?: SliderPropStatus;\n min?: number;\n size?: SliderPropSize;\n max?: number;\n onChange?: SliderPropOnChange<RANGE>;\n onAfterChange?: SliderPropOnChange<RANGE>;\n leftSide?: Side;\n tooltipFormatter?: SliderPropTooltipFormatter;\n rightSide?: Side;\n tooltipDirection?: Direction;\n tooltipPossibleDirections?: Direction[];\n};\n\nexport type Line = {\n width: number;\n active: boolean;\n size?: number[];\n};\n\nexport type SliderLineProps = {\n view?: SliderPropView;\n lines: Line[];\n disabled?: boolean;\n hovered?: boolean;\n onHover?: (hovered: boolean) => void;\n};\n\nexport type SliderPointProps = PropsWithHTMLAttributes<\n {\n value?: number;\n disabled?: boolean;\n focused?: boolean;\n hovered?: boolean;\n withTooltip?: boolean;\n handlePress?: (typeButton: ActiveButton) => void;\n buttonLabel?: ActiveButton;\n buttonRef?: React.RefObject<HTMLButtonElement>;\n popoverPosition?: TrackPosition;\n tooltipFormatter?: SliderPropTooltipFormatter;\n onFocus?: (\n e: React.FocusEvent<HTMLButtonElement> | React.MouseEvent,\n button: ActiveButton,\n ) => void;\n onKeyPress?: (e: React.KeyboardEvent, typeButton?: ActiveButton) => void;\n onHover?: (hovered: boolean) => void;\n position: number;\n active?: boolean;\n tooltipZIndex?: number;\n tooltipDirection?: Direction;\n tooltipPossibleDirections?: Direction[];\n },\n HTMLButtonElement\n>;\n\nexport type SliderProps<RANGE extends boolean> = PropsWithHTMLAttributes<\n Props<RANGE>,\n HTMLDivElement\n>;\n\nexport type SliderComponent = <RANGE extends boolean = false>(\n props: SliderProps<RANGE>,\n) => React.
|
|
1
|
+
{"version":3,"file":"helper.js","names":["sliderPropStatus","sliderPropStatusDefault","sliderPropSize","sliderPropSizeDefault","isRangeParams","params","range","isNotRangeParams","defaultTooltipFormatter","value","toString","getValueForInput","props","field","getOnChangeForInput","e","onChange","newValue","getIcon","side","getMaxForStartField","max","getMinForEndField","min","getValidStep","step","Array","isArray","Math","abs"],"sources":["../../../../../src/components/Slider/helper.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';\nimport { Direction } from '../Popover';\nimport { ActiveButton } from './useSlider/helper';\n\nexport const sliderPropStatus = ['alert', 'warning', 'success'] as const;\nexport type SliderPropStatus = typeof sliderPropStatus[number];\nexport const sliderPropStatusDefault = sliderPropStatus[0];\n\nexport type SliderPropView = 'default' | 'division';\n\nexport const sliderPropSize = ['s', 'xs', 'm', 'l'] as const;\nexport type SliderPropSize = typeof sliderPropSize[number];\nexport const sliderPropSizeDefault: SliderPropSize = sliderPropSize[0];\n\nexport type SliderValue<RANGE> = RANGE extends true ? [number, number] : number;\n\nexport type SliderPropOnChange<RANGE> = (\n value: SliderValue<RANGE>,\n prop: {\n e?:\n | Event\n | React.TouchEvent\n | React.MouseEvent\n | React.KeyboardEvent\n | React.ChangeEvent;\n },\n) => void;\n\ntype SliderPropTooltipFormatter = (value: number | undefined) => string;\n\ntype Side = IconComponent | 'input';\n\ntype Props<RANGE extends boolean = false> = {\n className?: string;\n step?: number | number[];\n view?: SliderPropView;\n disabled?: boolean;\n range?: RANGE;\n withTooltip?: boolean;\n value: SliderValue<RANGE>;\n label?: string;\n labelIcon?: IconComponent;\n caption?: string;\n status?: SliderPropStatus;\n min?: number;\n size?: SliderPropSize;\n max?: number;\n onChange?: SliderPropOnChange<RANGE>;\n onAfterChange?: SliderPropOnChange<RANGE>;\n leftSide?: Side;\n tooltipFormatter?: SliderPropTooltipFormatter;\n rightSide?: Side;\n tooltipDirection?: Direction;\n tooltipPossibleDirections?: Direction[];\n};\n\nexport type Line = {\n width: number;\n active: boolean;\n size?: number[];\n};\n\nexport type SliderLineProps = {\n view?: SliderPropView;\n lines: Line[];\n disabled?: boolean;\n hovered?: boolean;\n onHover?: (hovered: boolean) => void;\n};\n\nexport type SliderPointProps = PropsWithHTMLAttributes<\n {\n value?: number;\n disabled?: boolean;\n focused?: boolean;\n hovered?: boolean;\n withTooltip?: boolean;\n handlePress?: (typeButton: ActiveButton) => void;\n buttonLabel?: ActiveButton;\n buttonRef?: React.RefObject<HTMLButtonElement>;\n popoverPosition?: TrackPosition;\n tooltipFormatter?: SliderPropTooltipFormatter;\n onFocus?: (\n e: React.FocusEvent<HTMLButtonElement> | React.MouseEvent,\n button: ActiveButton,\n ) => void;\n onKeyPress?: (e: React.KeyboardEvent, typeButton?: ActiveButton) => void;\n onHover?: (hovered: boolean) => void;\n position: number;\n active?: boolean;\n tooltipZIndex?: number;\n tooltipDirection?: Direction;\n tooltipPossibleDirections?: Direction[];\n },\n HTMLButtonElement\n>;\n\nexport type SliderProps<RANGE extends boolean> = PropsWithHTMLAttributes<\n Props<RANGE>,\n HTMLDivElement\n>;\n\nexport type SliderComponent = <RANGE extends boolean = false>(\n props: SliderProps<RANGE>,\n) => React.ReactNode | null;\n\nexport const isRangeParams = (\n params: Props<boolean>,\n): params is Props<true> => {\n return !!params.range;\n};\n\nexport const isNotRangeParams = (\n params: Props<boolean>,\n): params is Props<false> => {\n return !params.range;\n};\n\nexport const defaultTooltipFormatter: SliderPropTooltipFormatter = (value) =>\n value?.toString() || '';\n\nexport type TrackPosition = {\n x: number;\n y: number;\n} | null;\n\nexport const getValueForInput = (\n props: SliderProps<boolean>,\n field: 0 | 1,\n): number => {\n if (isRangeParams(props)) {\n return props.value[field];\n }\n return props.value as number;\n};\n\ntype GetOnChangeForInputReturned = (props: {\n e?: React.ChangeEvent | React.MouseEvent | React.KeyboardEvent;\n value: number;\n}) => void;\n\nexport const getOnChangeForInput =\n (props: SliderProps<boolean>, field: 0 | 1): GetOnChangeForInputReturned =>\n ({ e, value }) => {\n if (!props.onChange) {\n return;\n }\n if (isNotRangeParams(props)) {\n props.onChange(value, { e });\n }\n if (isRangeParams(props)) {\n const newValue: SliderValue<true> = field\n ? [props.value[0], value]\n : [value, props.value[1]];\n props.onChange(newValue, {\n e,\n });\n }\n };\n\nexport const getIcon = (side?: Side) => {\n if (side !== 'input') {\n return side;\n }\n};\n\nexport const getMaxForStartField = (props: SliderProps<boolean>) => {\n if (isNotRangeParams(props)) {\n return props.max;\n }\n if (isRangeParams(props)) {\n return props.value[1];\n }\n};\n\nexport const getMinForEndField = (props: SliderProps<boolean>) => {\n if (isNotRangeParams(props)) {\n return props.min;\n }\n if (isRangeParams(props)) {\n return props.value[0];\n }\n};\n\nexport const getValidStep = (\n min: number,\n max: number,\n step?: number | number[],\n) => {\n if (step) {\n if (Array.isArray(step)) {\n return step;\n }\n if (step <= 0) {\n return 1;\n }\n return step;\n }\n return Math.abs((max - min) / 100);\n};\n"],"mappings":"AAOA,MAAO,IAAMA,iBAAgB,CAAG,CAAC,OAAD,CAAU,SAAV,CAAqB,SAArB,CAAzB,CAEP,MAAO,IAAMC,wBAAuB,CAAGD,gBAAgB,CAAC,CAAD,CAAhD,CAIP,MAAO,IAAME,eAAc,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAAvB,CAEP,MAAO,IAAMC,sBAAqC,CAAGD,cAAc,CAAC,CAAD,CAA5D,CA8FP,MAAO,IAAME,cAAa,CAAG,SAC3BC,CAD2B,CAED,CAC1B,MAAO,CAAC,CAACA,CAAM,CAACC,KACjB,CAJM,CAMP,MAAO,IAAMC,iBAAgB,CAAG,SAC9BF,CAD8B,CAEH,CAC3B,MAAO,CAACA,CAAM,CAACC,KAChB,CA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AMa,kBAAiB,CAAG,SAACV,CAAD,CAAiC,OAC5DL,iBAAgB,CAACK,CAAD,CAD4C,CAEvDA,CAAK,CAACW,GAFiD,CAI5DnB,aAAa,CAACQ,CAAD,CAJ+C,CAKvDA,CAAK,CAACH,KAAN,CAAY,CAAZ,CALuD,OAOjE,CAPM,CASP,MAAO,IAAMe,aAAY,CAAG,SAC1BD,CAD0B,CAE1BF,CAF0B,CAG1BI,CAH0B,CAIvB,OACCA,EADD,CAEGC,KAAK,CAACC,OAAN,CAAcF,CAAd,CAFH,CAGQA,CAHR,CAKW,CAAR,EAAAA,CALH,CAMQ,CANR,CAQMA,CARN,CAUIG,IAAI,CAACC,GAAL,CAAS,CAACR,CAAG,CAAGE,CAAP,EAAc,GAAvB,CACR,CAfM"}
|
|
@@ -2,5 +2,5 @@ import './SnackBarItem.css';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { SnackBarItemComponent, SnackBarItemProps } from '../types';
|
|
4
4
|
export declare const cnSnackBarItem: import("@bem-react/classname").ClassNameFormatter;
|
|
5
|
-
export declare const SnackBarItemRender: (props: SnackBarItemProps, ref: React.Ref<HTMLDivElement>) => JSX.Element;
|
|
5
|
+
export declare const SnackBarItemRender: (props: SnackBarItemProps, ref: React.Ref<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const SnackBarItem: SnackBarItemComponent;
|