@consta/uikit 5.13.0 → 5.15.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/FieldComponents/index.d.ts +1 -0
- package/FieldComponents/index.js +1 -0
- package/TextFieldCanary/index.d.ts +1 -0
- package/TextFieldCanary/index.js +1 -0
- package/__internal__/src/components/AutoComplete/helpers.d.ts +1 -1
- package/__internal__/src/components/AutoComplete/types.d.ts +1 -1
- package/__internal__/src/components/AutoComplete/types.js.map +1 -1
- package/__internal__/src/components/AutoComplete/useAutoComplete.d.ts +1 -1
- package/__internal__/src/components/AutoComplete/useAutoComplete.js +1 -1
- package/__internal__/src/components/AutoComplete/useAutoComplete.js.map +1 -1
- package/__internal__/src/components/AutoCompleteCanary/helpers.d.ts +1 -1
- package/__internal__/src/components/AutoCompleteCanary/types.d.ts +1 -1
- package/__internal__/src/components/AutoCompleteCanary/types.js.map +1 -1
- package/__internal__/src/components/AutoCompleteCanary/useAutoComplete.d.ts +1 -1
- package/__internal__/src/components/AutoCompleteCanary/useAutoComplete.js +1 -1
- package/__internal__/src/components/AutoCompleteCanary/useAutoComplete.js.map +1 -1
- package/__internal__/src/components/AvatarGroup/AvatarGroup.js.map +1 -1
- package/__internal__/src/components/Badge/Badge.css +1 -1
- package/__internal__/src/components/Badge/Badge.d.ts +2 -31
- package/__internal__/src/components/Badge/Badge.js +1 -1
- package/__internal__/src/components/Badge/Badge.js.map +1 -1
- package/__internal__/src/components/Badge/cn.d.ts +1 -0
- package/__internal__/src/components/Badge/cn.js +2 -0
- package/__internal__/src/components/Badge/cn.js.map +1 -0
- package/__internal__/src/components/Badge/guardStatus.d.ts +2 -0
- package/__internal__/src/components/Badge/guardStatus.js +2 -0
- package/__internal__/src/components/Badge/guardStatus.js.map +1 -0
- package/__internal__/src/components/Badge/index.d.ts +2 -0
- package/__internal__/src/components/Badge/index.js +1 -1
- package/__internal__/src/components/Badge/index.js.map +1 -1
- package/__internal__/src/components/Badge/maps.d.ts +9 -0
- package/__internal__/src/components/Badge/maps.js +2 -0
- package/__internal__/src/components/Badge/maps.js.map +1 -0
- package/__internal__/src/components/Badge/types.d.ts +31 -0
- package/__internal__/src/components/Badge/types.js +2 -0
- package/__internal__/src/components/Badge/types.js.map +1 -0
- package/__internal__/src/components/BadgeGroup/BadgeGroup.js +1 -1
- package/__internal__/src/components/BadgeGroup/BadgeGroup.js.map +1 -1
- package/__internal__/src/components/BadgeGroup/types.d.ts +4 -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/Breadcrumbs/BreadcrumbsItem/BreadcrumbsItem.css +1 -1
- package/__internal__/src/components/Checkbox/Checkbox.css +1 -1
- package/__internal__/src/components/CheckboxDeprecated/Checkbox.css +2 -2
- package/__internal__/src/components/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/__internal__/src/components/Chips/types.d.ts +8 -2
- package/__internal__/src/components/Chips/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/Combobox/Combobox.js +1 -1
- package/__internal__/src/components/Combobox/Combobox.js.map +1 -1
- package/__internal__/src/components/Combobox/helpers.d.ts +2 -2
- package/__internal__/src/components/Combobox/helpers.js.map +1 -1
- package/__internal__/src/components/ComboboxDeprecated/ComboboxDeprecated.js +1 -1
- package/__internal__/src/components/ComboboxDeprecated/ComboboxDeprecated.js.map +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuLevel/ContextMenuLevel.js +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuLevel/ContextMenuLevel.js.map +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuLevelWrapper/ContextMenuLevelWrapper.js +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuLevelWrapper/ContextMenuLevelWrapper.js.map +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuWrapper/ContextMenuWrapper.css +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuWrapper/ContextMenuWrapper.js +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuWrapper/ContextMenuWrapper.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerDropdown/DatePickerDropdown.css +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateRange/DatePickerTypeDateRange.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateRange/DatePickerTypeDateRange.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeMonthRange/DatePickerTypeMonthRange.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeMonthRange/DatePickerTypeMonthRange.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeYearRange/DatePickerTypeYearRange.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeYearRange/DatePickerTypeYearRange.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTime10Years/DateTime10Years.css +1 -1
- package/__internal__/src/components/DateTime/DateTimeCell/DateTimeCell.css +1 -1
- package/__internal__/src/components/DateTime/DateTimeMonth/DateTimeMonth.css +1 -1
- package/__internal__/src/components/DateTime/DateTimeTimeColumn/DateTimeTimeColumn.css +1 -1
- package/__internal__/src/components/DateTime/DateTimeTimeColumn/DateTimeTimeColumn.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTimeColumn/DateTimeTimeColumn.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTimeColumn/useScrollToElement/useScrollToElement.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeTime/DateTimeTypeTime.css +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeTime/DateTimeTypeTime.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeYear/DateTimeYear.css +1 -1
- package/__internal__/src/components/DateTime/helpers/getSliderValueRange.js +1 -1
- package/__internal__/src/components/DateTime/helpers/getSliderValueRange.js.map +1 -1
- package/__internal__/src/components/DragNDropField/DragNDropField.js +1 -1
- package/__internal__/src/components/DragNDropField/DragNDropField.js.map +1 -1
- package/__internal__/src/components/DragNDropField/formatAccept.js.map +1 -1
- package/__internal__/src/components/DragNDropField/locale.d.ts +1 -1
- package/__internal__/src/components/DragNDropField/locale.js +1 -1
- package/__internal__/src/components/DragNDropField/locale.js.map +1 -1
- package/__internal__/src/components/DragNDropFieldCanary/DragNDropFieldCanary.js +1 -1
- package/__internal__/src/components/DragNDropFieldCanary/DragNDropFieldCanary.js.map +1 -1
- package/__internal__/src/components/DragNDropFieldCanary/renderChildren.d.ts +3 -0
- package/__internal__/src/components/DragNDropFieldCanary/renderChildren.js +2 -0
- package/__internal__/src/components/DragNDropFieldCanary/renderChildren.js.map +1 -0
- package/__internal__/src/components/FieldComponents/FieldArrayValueInlineControl/FieldArrayValueInlineControl.js +1 -1
- package/__internal__/src/components/FieldComponents/FieldArrayValueInlineControl/FieldArrayValueInlineControl.js.map +1 -1
- package/__internal__/src/components/FieldComponents/FieldArrayValueInlineControl/types.d.ts +2 -1
- package/__internal__/src/components/FieldComponents/FieldArrayValueInlineControl/types.js.map +1 -1
- package/__internal__/src/components/FieldComponents/FieldComponents.d.ts +15 -0
- package/__internal__/src/components/FieldComponents/FieldComponents.js +2 -0
- package/__internal__/src/components/FieldComponents/FieldComponents.js.map +1 -0
- package/__internal__/src/components/FieldComponents/FieldControlLayout/FieldControlLayout.css +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/FieldControlLayout.js +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/FieldControlLayout.js.map +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/helpers.js.map +1 -1
- package/__internal__/src/components/FieldComponents/FieldWrapper/FieldWrapper.js +1 -1
- package/__internal__/src/components/FieldComponents/FieldWrapper/FieldWrapper.js.map +1 -1
- package/__internal__/src/components/FieldComponents/index.d.ts +1 -15
- package/__internal__/src/components/FieldComponents/index.js +1 -1
- package/__internal__/src/components/FieldComponents/index.js.map +1 -1
- package/__internal__/src/components/Grid/helpers.js.map +1 -1
- package/__internal__/src/components/Informer/Informer.css +1 -1
- package/__internal__/src/components/Informer/Informer.d.ts +1 -1
- package/__internal__/src/components/Informer/Informer.js +1 -1
- package/__internal__/src/components/Informer/Informer.js.map +1 -1
- package/__internal__/src/components/Layout/useFixed.js +1 -1
- package/__internal__/src/components/Layout/useFixed.js.map +1 -1
- package/__internal__/src/components/ListCanary/ListAddItem/ListAddItem.js +1 -1
- package/__internal__/src/components/ListCanary/ListAddItem/ListAddItem.js.map +1 -1
- package/__internal__/src/components/ListCanary/ListBox/ListBox.js +1 -1
- package/__internal__/src/components/ListCanary/ListBox/ListBox.js.map +1 -1
- package/__internal__/src/components/ListCanary/ListBox/index.d.ts +1 -1
- package/__internal__/src/components/ListCanary/ListBox/index.js +1 -1
- package/__internal__/src/components/ListCanary/ListBox/index.js.map +1 -1
- package/__internal__/src/components/ListCanary/ListBox/{mapVerticalSpase.d.ts → mapVerticalSpace.d.ts} +1 -1
- package/__internal__/src/components/ListCanary/ListBox/mapVerticalSpace.js +2 -0
- package/__internal__/src/components/ListCanary/ListBox/mapVerticalSpace.js.map +1 -0
- package/__internal__/src/components/ListCanary/ListCanary.js +1 -1
- package/__internal__/src/components/ListCanary/ListCanary.js.map +1 -1
- package/__internal__/src/components/ListCanary/ListDivider/ListDivider.js +1 -1
- package/__internal__/src/components/ListCanary/ListDivider/ListDivider.js.map +1 -1
- package/__internal__/src/components/ListCanary/ListGroupLabel/ListGroupLabel.js +1 -1
- package/__internal__/src/components/ListCanary/ListGroupLabel/ListGroupLabel.js.map +1 -1
- package/__internal__/src/components/ListCanary/ListItem/ListItem.js +1 -1
- package/__internal__/src/components/ListCanary/ListItem/ListItem.js.map +1 -1
- package/__internal__/src/components/ListCanary/ListLoader/ListLoader.js +1 -1
- package/__internal__/src/components/ListCanary/ListLoader/ListLoader.js.map +1 -1
- package/__internal__/src/components/ListCanary/helper.d.ts +3 -3
- package/__internal__/src/components/ListCanary/maps.d.ts +4 -4
- package/__internal__/src/components/ListCanary/maps.js +1 -1
- package/__internal__/src/components/ListCanary/maps.js.map +1 -1
- package/__internal__/src/components/ListCanary/renderHeader.d.ts +1 -1
- package/__internal__/src/components/ListCanary/renderHeader.js.map +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/Pagination/Pagination.js.map +1 -1
- package/__internal__/src/components/Pagination/PaginationList/PaginationList.css +1 -1
- package/__internal__/src/components/Pagination/PaginationList/PaginationList.js +1 -1
- package/__internal__/src/components/Pagination/PaginationList/PaginationList.js.map +1 -1
- package/__internal__/src/components/Pagination/helpers.js.map +1 -1
- package/__internal__/src/components/Pagination/usePaginationItems.js.map +1 -1
- package/__internal__/src/components/Popover/Popover.d.ts +2 -1
- package/__internal__/src/components/Popover/Popover.js +1 -1
- package/__internal__/src/components/Popover/Popover.js.map +1 -1
- package/__internal__/src/components/Popover/helpers.d.ts +1 -1
- package/__internal__/src/components/Popover/helpers.js +1 -1
- package/__internal__/src/components/Popover/helpers.js.map +1 -1
- package/__internal__/src/components/Popover/usePopoverReposition.d.ts +2 -2
- package/__internal__/src/components/Popover/usePopoverReposition.js.map +1 -1
- package/__internal__/src/components/PortalWithTheme/PortalWithTheme.js.map +1 -1
- package/__internal__/src/components/PortalWithTheme/PortalWithThemeContext/PortalWithThemeContext.d.ts +4 -4
- package/__internal__/src/components/PortalWithTheme/PortalWithThemeContext/PortalWithThemeContext.js.map +1 -1
- package/__internal__/src/components/ProgressLine/helpers.js.map +1 -1
- package/__internal__/src/components/ProgressLine/types.d.ts +2 -2
- package/__internal__/src/components/ProgressLine/types.js.map +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/Select/helpers.d.ts +2 -2
- package/__internal__/src/components/Select/helpers.js.map +1 -1
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.d.ts +3 -3
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js +1 -1
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js.map +1 -1
- package/__internal__/src/components/SelectComponents/helpers.d.ts +2 -2
- package/__internal__/src/components/SelectComponents/helpers.js +1 -1
- package/__internal__/src/components/SelectComponents/helpers.js.map +1 -1
- package/__internal__/src/components/SelectComponents/useSelect/useSelect.d.ts +1 -1
- package/__internal__/src/components/SelectComponents/useSelect/useSelect.js +1 -1
- package/__internal__/src/components/SelectComponents/useSelect/useSelect.js.map +1 -1
- package/__internal__/src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.d.ts +2 -2
- package/__internal__/src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.js +1 -1
- package/__internal__/src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.js.map +1 -1
- package/__internal__/src/components/SelectComponentsDeprecated/helpers.d.ts +2 -2
- package/__internal__/src/components/SelectComponentsDeprecated/helpers.js +1 -1
- package/__internal__/src/components/SelectComponentsDeprecated/helpers.js.map +1 -1
- package/__internal__/src/components/Slider/Slider.js +1 -1
- package/__internal__/src/components/Slider/Slider.js.map +1 -1
- package/__internal__/src/components/Slider/helper.d.ts +6 -6
- package/__internal__/src/components/Slider/helper.js +1 -1
- package/__internal__/src/components/Slider/helper.js.map +1 -1
- package/__internal__/src/components/Slider/useSlider/helper.d.ts +2 -2
- package/__internal__/src/components/Slider/useSlider/helper.js +1 -1
- package/__internal__/src/components/Slider/useSlider/helper.js.map +1 -1
- package/__internal__/src/components/Slider/useSlider/useSlider.js +1 -1
- package/__internal__/src/components/Slider/useSlider/useSlider.js.map +1 -1
- package/__internal__/src/components/Slider/useSliderStationing.js.map +1 -1
- package/__internal__/src/components/SnackBar/SnackBar.js +1 -1
- package/__internal__/src/components/SnackBar/SnackBar.js.map +1 -1
- package/__internal__/src/components/SnackBar/SnackBarActionButton/SnackBarActionButton.js +1 -1
- package/__internal__/src/components/SnackBar/SnackBarActionButton/SnackBarActionButton.js.map +1 -1
- package/__internal__/src/components/SnackBar/SnackBarActionButton/index.d.ts +1 -0
- package/__internal__/src/components/SnackBar/SnackBarActionButton/index.js +2 -0
- package/__internal__/src/components/SnackBar/SnackBarActionButton/index.js.map +1 -0
- package/__internal__/src/components/SnackBar/SnackBarItem/SnackBarItem.css +1 -1
- package/__internal__/src/components/SnackBar/SnackBarItem/SnackBarItem.d.ts +0 -1
- package/__internal__/src/components/SnackBar/SnackBarItem/SnackBarItem.js +1 -1
- package/__internal__/src/components/SnackBar/SnackBarItem/SnackBarItem.js.map +1 -1
- package/__internal__/src/components/SnackBar/SnackBarItem/index.d.ts +1 -0
- package/__internal__/src/components/SnackBar/SnackBarItem/index.js +2 -0
- package/__internal__/src/components/SnackBar/SnackBarItem/index.js.map +1 -0
- package/__internal__/src/components/SnackBar/SnackBarLine/SnackBarLine.js.map +1 -1
- package/__internal__/src/components/SnackBar/SnackBarLine/index.d.ts +1 -0
- package/__internal__/src/components/SnackBar/SnackBarLine/index.js +2 -0
- package/__internal__/src/components/SnackBar/SnackBarLine/index.js.map +1 -0
- package/__internal__/src/components/SnackBar/SnackBarProgress/SnackBarProgress.css +1 -0
- package/__internal__/src/components/SnackBar/SnackBarProgress/SnackBarProgress.d.ts +4 -0
- package/__internal__/src/components/SnackBar/SnackBarProgress/SnackBarProgress.js +2 -0
- package/__internal__/src/components/SnackBar/SnackBarProgress/SnackBarProgress.js.map +1 -0
- package/__internal__/src/components/SnackBar/SnackBarProgress/index.d.ts +1 -0
- package/__internal__/src/components/SnackBar/SnackBarProgress/index.js +2 -0
- package/__internal__/src/components/SnackBar/SnackBarProgress/index.js.map +1 -0
- package/__internal__/src/components/SnackBar/SnackBarTimer/SnackBarTimer.js +1 -1
- package/__internal__/src/components/SnackBar/SnackBarTimer/SnackBarTimer.js.map +1 -1
- package/__internal__/src/components/SnackBar/SnackBarTimer/index.d.ts +1 -0
- package/__internal__/src/components/SnackBar/SnackBarTimer/index.js +2 -0
- package/__internal__/src/components/SnackBar/SnackBarTimer/index.js.map +1 -0
- package/__internal__/src/components/SnackBar/helper.d.ts +4 -1
- package/__internal__/src/components/SnackBar/helper.js +1 -1
- package/__internal__/src/components/SnackBar/helper.js.map +1 -1
- package/__internal__/src/components/SnackBar/types.d.ts +15 -0
- package/__internal__/src/components/SnackBar/types.js +1 -1
- package/__internal__/src/components/SnackBar/types.js.map +1 -1
- package/__internal__/src/components/Spoiler/types.d.ts +4 -4
- package/__internal__/src/components/Spoiler/types.js +1 -1
- package/__internal__/src/components/Spoiler/types.js.map +1 -1
- package/__internal__/src/components/Steps/Steps.d.ts +2 -2
- package/__internal__/src/components/Steps/Steps.js.map +1 -1
- package/__internal__/src/components/Steps/StepsStep/StepsStep.js +1 -1
- package/__internal__/src/components/Steps/StepsStep/StepsStep.js.map +1 -1
- package/__internal__/src/components/Steps/types.d.ts +1 -1
- package/__internal__/src/components/Steps/types.js.map +1 -1
- package/__internal__/src/components/Table/Header/TableHeader.js +1 -1
- package/__internal__/src/components/Table/Header/TableHeader.js.map +1 -1
- package/__internal__/src/components/Table/Resizer/TableResizer.js.map +1 -1
- package/__internal__/src/components/Table/Table.css +1 -1
- package/__internal__/src/components/Table/Table.js +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/Table/__mock__/data.mock.js +1 -1
- package/__internal__/src/components/Table/__mock__/data.mock.js.map +1 -1
- package/__internal__/src/components/Table/helpers.d.ts +2 -2
- package/__internal__/src/components/Table/helpers.js +1 -1
- package/__internal__/src/components/Table/helpers.js.map +1 -1
- package/__internal__/src/components/Tabs/TabsFitModeScrollWrapper/__test__/helpers.test.js +1 -1
- package/__internal__/src/components/Tabs/TabsFitModeScrollWrapper/__test__/helpers.test.js.map +1 -1
- package/__internal__/src/components/TagBase/TagBase.css +1 -1
- package/__internal__/src/components/TextField/TextField.js +1 -1
- package/__internal__/src/components/TextField/TextField.js.map +1 -1
- package/__internal__/src/components/TextField/helpers.d.ts +1 -1
- package/__internal__/src/components/TextField/helpers.js.map +1 -1
- package/__internal__/src/components/TextFieldCanary/{TextField.js → TextFieldCanary.js} +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldCanary.js.map +1 -0
- package/__internal__/src/components/TextFieldCanary/TextFieldTypeNumber/TextFieldTypeNumber.js +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldTypeNumber/TextFieldTypeNumber.js.map +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldTypePassword/TextFieldTypePassword.js +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldTypePassword/TextFieldTypePassword.js.map +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldTypeText/TextFieldTypeText.js +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldTypeText/TextFieldTypeText.js.map +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldTypeTextArea/TextFieldTypeTextArea.css +3 -3
- package/__internal__/src/components/TextFieldCanary/TextFieldTypeTextArea/TextFieldTypeTextArea.js +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldTypeTextArea/TextFieldTypeTextArea.js.map +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldTypeTextArray/TextFieldTypeTextArray.css +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/index.d.ts +1 -1
- package/__internal__/src/components/TextFieldCanary/index.js +1 -1
- package/__internal__/src/components/TextFieldCanary/index.js.map +1 -1
- package/__internal__/src/components/TextFieldCanary/types.d.ts +1 -0
- package/__internal__/src/components/TextFieldCanary/types.js.map +1 -1
- package/__internal__/src/components/UserSelect/UserSelect.js +1 -1
- package/__internal__/src/components/UserSelect/UserSelect.js.map +1 -1
- package/__internal__/src/components/UserSelect/UserSelectItem/UserSelectItem.js +1 -1
- package/__internal__/src/components/UserSelect/UserSelectItem/UserSelectItem.js.map +1 -1
- package/__internal__/src/components/UserSelect/helpers.d.ts +2 -2
- package/__internal__/src/components/UserSelect/helpers.js.map +1 -1
- package/__internal__/src/components/UserSelectDeprecated/UserSelectDeprecated.js +1 -1
- package/__internal__/src/components/UserSelectDeprecated/UserSelectDeprecated.js.map +1 -1
- package/__internal__/src/components/UserSelectDeprecated/UserSelectItem/UserSelectItem.js +1 -1
- package/__internal__/src/components/UserSelectDeprecated/UserSelectItem/UserSelectItem.js.map +1 -1
- package/__internal__/src/hocs/withTooltip/withTooltip.js.map +1 -1
- package/__internal__/src/hooks/{useBreakpointsDepricated → useBreakpointsDeprecated}/addPrefix.js.map +1 -1
- package/__internal__/src/hooks/{useBreakpointsDepricated → useBreakpointsDeprecated}/getLastPoint.js.map +1 -1
- package/__internal__/src/hooks/useBreakpointsDeprecated/index.d.ts +3 -0
- package/__internal__/src/hooks/useBreakpointsDeprecated/index.js +2 -0
- package/__internal__/src/hooks/useBreakpointsDeprecated/index.js.map +1 -0
- package/__internal__/src/hooks/{useBreakpointsDepricated → useBreakpointsDeprecated}/mapping.js.map +1 -1
- package/__internal__/src/hooks/{useBreakpointsDepricated → useBreakpointsDeprecated}/types.js.map +1 -1
- package/__internal__/src/hooks/useBreakpointsDeprecated/useBreakpointsDeprecated.d.ts +2 -0
- package/__internal__/src/hooks/useBreakpointsDeprecated/useBreakpointsDeprecated.js +2 -0
- package/__internal__/src/hooks/useBreakpointsDeprecated/useBreakpointsDeprecated.js.map +1 -0
- package/__internal__/src/hooks/useBreakpointsDepricated/index.d.ts +0 -2
- package/__internal__/src/hooks/useBreakpointsDepricated/index.js +1 -1
- package/__internal__/src/hooks/useBreakpointsDepricated/index.js.map +1 -1
- package/__internal__/src/hooks/useBreakpointsDepricated/useBreakpointsDepricated.d.ts +1 -2
- package/__internal__/src/hooks/useBreakpointsDepricated/useBreakpointsDepricated.js +1 -1
- package/__internal__/src/hooks/useBreakpointsDepricated/useBreakpointsDepricated.js.map +1 -1
- package/__internal__/src/hooks/useChoiceGroup/useChoiceGroup.js.map +1 -1
- package/__internal__/src/hooks/useClickOutside/useClickOutside.js.map +1 -1
- package/__internal__/src/hooks/useComponentBreakpointsDeprecated/index.d.ts +2 -0
- package/__internal__/src/hooks/useComponentBreakpointsDeprecated/index.js +2 -0
- package/__internal__/src/hooks/useComponentBreakpointsDeprecated/index.js.map +1 -0
- package/__internal__/src/hooks/useComponentBreakpointsDeprecated/useComponentBreakpointsDeprecated.d.ts +2 -0
- package/__internal__/src/hooks/useComponentBreakpointsDeprecated/useComponentBreakpointsDeprecated.js +2 -0
- package/__internal__/src/hooks/useComponentBreakpointsDeprecated/useComponentBreakpointsDeprecated.js.map +1 -0
- package/__internal__/src/hooks/useComponentBreakpointsDepricated/index.d.ts +0 -1
- package/__internal__/src/hooks/useComponentBreakpointsDepricated/index.js +1 -1
- package/__internal__/src/hooks/useComponentBreakpointsDepricated/index.js.map +1 -1
- package/__internal__/src/hooks/useComponentBreakpointsDepricated/useComponentBreakpointsDepricated.d.ts +1 -2
- package/__internal__/src/hooks/useComponentBreakpointsDepricated/useComponentBreakpointsDepricated.js +1 -1
- package/__internal__/src/hooks/useComponentBreakpointsDepricated/useComponentBreakpointsDepricated.js.map +1 -1
- package/__internal__/src/hooks/useHideElementsInLineDeprecated/index.d.ts +1 -0
- package/__internal__/src/hooks/useHideElementsInLineDeprecated/index.js +2 -0
- package/__internal__/src/hooks/useHideElementsInLineDeprecated/index.js.map +1 -0
- package/__internal__/src/hooks/useHideElementsInLineDeprecated/useHideElementsInLineDeprecated.d.ts +10 -0
- package/__internal__/src/hooks/useHideElementsInLineDeprecated/useHideElementsInLineDeprecated.js +2 -0
- package/__internal__/src/hooks/useHideElementsInLineDeprecated/useHideElementsInLineDeprecated.js.map +1 -0
- package/__internal__/src/hooks/useHideElementsInLineDepricated/index.js.map +1 -1
- package/__internal__/src/hooks/useHideElementsInLineDepricated/useHideElementsInLineDepricated.d.ts +1 -10
- package/__internal__/src/hooks/useHideElementsInLineDepricated/useHideElementsInLineDepricated.js +1 -1
- package/__internal__/src/hooks/useHideElementsInLineDepricated/useHideElementsInLineDepricated.js.map +1 -1
- package/__internal__/src/hooks/useKeysDeprecated/index.d.ts +1 -0
- package/__internal__/src/hooks/useKeysDeprecated/index.js +2 -0
- package/__internal__/src/hooks/useKeysDeprecated/index.js.map +1 -0
- package/__internal__/src/hooks/useKeysDeprecated/useKeysDeprecated.d.ts +18 -0
- package/__internal__/src/hooks/useKeysDeprecated/useKeysDeprecated.js +2 -0
- package/__internal__/src/hooks/useKeysDeprecated/useKeysDeprecated.js.map +1 -0
- package/__internal__/src/hooks/useKeysDepricated/index.js.map +1 -1
- package/__internal__/src/hooks/useKeysDepricated/useKeysDepricated.d.ts +1 -18
- package/__internal__/src/hooks/useKeysDepricated/useKeysDepricated.js +1 -1
- package/__internal__/src/hooks/useKeysDepricated/useKeysDepricated.js.map +1 -1
- package/__internal__/src/hooks/useResizableContent/helpers.d.ts +1 -1
- package/__internal__/src/hooks/useResizableContent/helpers.js +1 -1
- package/__internal__/src/hooks/useResizableContent/helpers.js.map +1 -1
- package/__internal__/src/hooks/useResizableContent/useResizableContent.js +1 -1
- package/__internal__/src/hooks/useResizableContent/useResizableContent.js.map +1 -1
- package/__internal__/src/hooks/useSelect/useSelect.d.ts +1 -1
- package/__internal__/src/hooks/useSelect/useSelect.js +1 -1
- package/__internal__/src/hooks/useSelect/useSelect.js.map +1 -1
- package/__internal__/src/hooks/useVirtualScroll/helpers.js +2 -0
- package/__internal__/src/hooks/useVirtualScroll/helpers.js.map +1 -0
- package/__internal__/src/hooks/useVirtualScroll/useVirtualScroll.d.ts +1 -1
- package/__internal__/src/hooks/useVirtualScroll/useVirtualScroll.js +1 -1
- package/__internal__/src/hooks/useVirtualScroll/useVirtualScroll.js.map +1 -1
- package/__internal__/src/mixs/MixPopoverAnimate/MixPopoverAnimate.css +1 -1
- package/__internal__/src/uiKit/components/ThemePreview/ThemePreview.js +1 -1
- package/__internal__/src/uiKit/components/ThemePreview/ThemePreview.js.map +1 -1
- package/__internal__/src/uiKit/components/ThemePreview/helpers.d.ts +4 -4
- package/__internal__/src/uiKit/components/ThemePreview/helpers.js +1 -1
- package/__internal__/src/uiKit/components/ThemePreview/helpers.js.map +1 -1
- package/__internal__/src/utils/date/index.d.ts +1 -1
- package/__internal__/src/utils/date/index.js +1 -1
- package/__internal__/src/utils/date/index.js.map +1 -1
- package/__internal__/src/utils/date/isDisableDate.js +1 -1
- package/__internal__/src/utils/date/isDisableDate.js.map +1 -1
- package/__internal__/src/utils/date/{isInMinMaxDade.js → isInMinMaxDate.js} +1 -1
- package/__internal__/src/utils/date/{isInMinMaxDade.js.map → isInMinMaxDate.js.map} +1 -1
- package/__internal__/src/utils/getGroups.d.ts +3 -3
- package/__internal__/src/utils/getGroups.js +1 -1
- package/__internal__/src/utils/getGroups.js.map +1 -1
- package/__internal__/src/utils/types/AutoComplete.js.map +1 -1
- package/__internal__/src/utils/types/KeyCode.d.ts +3 -3
- package/__internal__/src/utils/types/KeyCode.js.map +1 -1
- package/package.json +1 -1
- package/useBreakpointsDeprecated/index.d.ts +1 -0
- package/useBreakpointsDeprecated/index.js +1 -0
- package/useComponentBreakpointsDeprecated/index.d.ts +1 -0
- package/useComponentBreakpointsDeprecated/index.js +1 -0
- package/useHideElementsInLineDeprecated/index.d.ts +1 -0
- package/useHideElementsInLineDeprecated/index.js +1 -0
- package/useKeysDeprecated/index.d.ts +1 -0
- package/useKeysDeprecated/index.js +1 -0
- package/__internal__/src/components/DragNDropFieldCanary/renderCildren.d.ts +0 -3
- package/__internal__/src/components/DragNDropFieldCanary/renderCildren.js +0 -2
- package/__internal__/src/components/DragNDropFieldCanary/renderCildren.js.map +0 -1
- package/__internal__/src/components/ListCanary/ListBox/mapVerticalSpase.js +0 -2
- package/__internal__/src/components/ListCanary/ListBox/mapVerticalSpase.js.map +0 -1
- package/__internal__/src/components/TextFieldCanary/TextField.js.map +0 -1
- package/__internal__/src/hooks/useVirtualScroll/hellpers.js +0 -2
- package/__internal__/src/hooks/useVirtualScroll/hellpers.js.map +0 -1
- package/__internal__/src/uiKit/components/StoryBookExample/StoryBookExample.css +0 -1
- package/__internal__/src/uiKit/components/StoryBookExample/StoryBookExample.d.ts +0 -6
- package/__internal__/src/uiKit/components/StoryBookExample/StoryBookExample.js +0 -2
- package/__internal__/src/uiKit/components/StoryBookExample/StoryBookExample.js.map +0 -1
- /package/__internal__/src/components/TextFieldCanary/{TextField.d.ts → TextFieldCanary.d.ts} +0 -0
- /package/__internal__/src/hooks/{useBreakpointsDepricated → useBreakpointsDeprecated}/addPrefix.d.ts +0 -0
- /package/__internal__/src/hooks/{useBreakpointsDepricated → useBreakpointsDeprecated}/addPrefix.js +0 -0
- /package/__internal__/src/hooks/{useBreakpointsDepricated → useBreakpointsDeprecated}/getLastPoint.d.ts +0 -0
- /package/__internal__/src/hooks/{useBreakpointsDepricated → useBreakpointsDeprecated}/getLastPoint.js +0 -0
- /package/__internal__/src/hooks/{useBreakpointsDepricated → useBreakpointsDeprecated}/mapping.d.ts +0 -0
- /package/__internal__/src/hooks/{useBreakpointsDepricated → useBreakpointsDeprecated}/mapping.js +0 -0
- /package/__internal__/src/hooks/{useBreakpointsDepricated → useBreakpointsDeprecated}/types.d.ts +0 -0
- /package/__internal__/src/hooks/{useBreakpointsDepricated → useBreakpointsDeprecated}/types.js +0 -0
- /package/__internal__/src/hooks/useVirtualScroll/{hellpers.d.ts → helpers.d.ts} +0 -0
- /package/__internal__/src/utils/date/{isInMinMaxDade.d.ts → isInMinMaxDate.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserSelectDeprecated.js","names":["IconClear","IconSelect","React","forwardRef","useRef","isNotNil","useForkRef","useSelect","cnMixFocus","clearSizeMap","usePropsHandler","cnSelect","defaultlabelForCreate","defaultLabelForEmptyItems","defaultlabelForNotFound","getInputWidth","SelectContainer","SelectDropdown","defaultPropForm","defaultPropSize","defaultPropView","iconSizeMap","isMultipleParams","isNotMultipleParams","searchCompare","withDefaultGetters","UserSelectItem","UserSelectValue","COMPONENT_NAME","UserSelectRender","props","ref","defaultDropdownRef","controlInnerRef","helperInputFakeElement","controlRef","placeholder","onBlur","onFocus","items","onChange","value","disabled","ariaLabel","id","isLoading","required","dropdownRef","form","view","size","dropdownClassName","searchValueProp","searchValue","name","groups","getItemKey","getItemLabel","getItemSubLabel","getItemAvatarUrl","getItemGroupKey","getItemDisabled","getGroupKey","getGroupLabel","renderItem","renderValueProp","renderValue","onCreate","inputRefProp","inputRef","labelForNotFound","labelForCreate","labelForEmptyItems","multiple","searchFunction","style","dropdownForm","restProps","searchFunctionDefault","item","searchOfLabel","getKeyProps","getOptionProps","isOpen","visibleItems","isFocused","handleInputFocus","handleInputBlur","handleToggleDropdown","handleInputClick","handleInputChange","clearValue","getHandleRemoveValue","notFound","hasItems","inputId","renderValueDefault","handleRemove","inputRefForRender","renderControlValue","width","Array","isArray","map","length","hide","isUserSelect","hasInput","renderItemDefault","active","hovered","onClick","onMouseEnter","zIndex","UserSelect"],"sources":["../../../../../src/components/UserSelectDeprecated/UserSelectDeprecated.tsx"],"sourcesContent":["import '../SelectComponentsDeprecated/Select.css';\n\nimport { IconClear } from '@consta/icons/IconClear';\nimport { IconSelect } from '@consta/icons/IconSelect';\nimport React, { forwardRef, useRef } from 'react';\n\nimport { isNotNil } from '##/utils/type-guards';\n\nimport { useForkRef } from '../../hooks/useForkRef/useForkRef';\nimport { useSelect } from '../../hooks/useSelect/useSelect';\nimport { cnMixFocus } from '../../mixs/MixFocus/MixFocus';\nimport { clearSizeMap } from '../ComboboxDeprecated';\nimport { usePropsHandler } from '../EventInterceptor/usePropsHandler';\nimport { cnSelect } from '../SelectComponentsDeprecated/cnSelect';\nimport {\n defaultlabelForCreate,\n defaultLabelForEmptyItems,\n defaultlabelForNotFound,\n getInputWidth,\n} from '../SelectComponentsDeprecated/helpers';\nimport { SelectContainer } from '../SelectComponentsDeprecated/SelectContainer/SelectContainer';\nimport { SelectDropdown } from '../SelectComponentsDeprecated/SelectDropdown/SelectDropdown';\nimport {\n defaultPropForm,\n defaultPropSize,\n defaultPropView,\n} from '../SelectComponentsDeprecated/types';\nimport {\n DefaultGroup,\n DefaultItem,\n iconSizeMap,\n isMultipleParams,\n isNotMultipleParams,\n PropRenderItem,\n PropRenderValue,\n searchCompare,\n UserSelectComponent,\n UserSelectProps,\n withDefaultGetters,\n} from './helpers';\nimport { UserSelectItem } from './UserSelectItem/UserSelectItem';\nimport { UserSelectValue } from './UserSelectValue/UserSelectValue';\n\nexport const COMPONENT_NAME = 'UserSelect' as const;\n\nconst UserSelectRender = <\n ITEM = DefaultItem,\n GROUP = DefaultGroup,\n MULTIPLE extends boolean = false,\n>(\n props: UserSelectProps<ITEM, GROUP, MULTIPLE>,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const defaultDropdownRef = useRef<HTMLDivElement | null>(null);\n const controlInnerRef = useRef<HTMLDivElement>(null);\n const helperInputFakeElement = useRef<HTMLDivElement>(null);\n const controlRef = useRef<HTMLDivElement | null>(null);\n\n const {\n placeholder,\n onBlur,\n onFocus,\n items,\n onChange,\n value,\n disabled,\n ariaLabel,\n id,\n isLoading,\n required,\n dropdownRef = defaultDropdownRef,\n form = defaultPropForm,\n view = defaultPropView,\n size = defaultPropSize,\n dropdownClassName,\n searchValue: searchValueProp,\n name,\n groups = [],\n getItemKey,\n getItemLabel,\n getItemSubLabel,\n getItemAvatarUrl,\n getItemGroupKey,\n getItemDisabled,\n getGroupKey,\n getGroupLabel,\n renderItem,\n renderValue: renderValueProp,\n onCreate,\n inputRef: inputRefProp,\n labelForNotFound = defaultlabelForNotFound,\n labelForCreate = defaultlabelForCreate,\n labelForEmptyItems = defaultLabelForEmptyItems,\n multiple = false,\n searchFunction,\n style,\n dropdownForm = 'default',\n ...restProps\n } = usePropsHandler(COMPONENT_NAME, withDefaultGetters(props), controlRef);\n\n const searchFunctionDefault = (item: ITEM, searchValue: string): boolean => {\n const searchOfLabel = searchCompare(searchValue, getItemLabel(item));\n\n if (searchOfLabel) {\n return searchOfLabel;\n }\n\n return searchCompare(searchValue, getItemSubLabel(item));\n };\n\n const {\n getKeyProps,\n getOptionProps,\n isOpen,\n visibleItems,\n isFocused,\n handleInputFocus,\n handleInputBlur,\n handleToggleDropdown,\n inputRef,\n handleInputClick,\n handleInputChange,\n searchValue,\n clearValue,\n getHandleRemoveValue,\n notFound,\n hasItems,\n } = useSelect({\n items,\n groups,\n value,\n onChange,\n dropdownRef,\n controlRef,\n disabled,\n getItemLabel,\n getItemKey,\n getGroupKey,\n getItemGroupKey,\n searchValue: searchValueProp,\n getItemDisabled,\n multiple,\n onBlur,\n onFocus,\n onCreate,\n searchFunction: searchFunction || searchFunctionDefault,\n });\n\n const inputId = id ? `${id}-input` : id;\n\n const renderItemDefault: PropRenderItem<ITEM> = (props) => {\n const { item, active, hovered, onClick, onMouseEnter } = props;\n\n return (\n <UserSelectItem\n label={getItemLabel(item)}\n subLabel={getItemSubLabel(item)}\n avatarUrl={getItemAvatarUrl(item)}\n active={active}\n hovered={hovered}\n size={size}\n indent={dropdownForm === 'round' ? 'increased' : 'normal'}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n disable={getItemDisabled(item)}\n multiple={multiple}\n />\n );\n };\n\n const renderValueDefault: PropRenderValue<ITEM> = ({\n item,\n handleRemove,\n }) => {\n return (\n <UserSelectValue\n label={getItemLabel(item)}\n subLabel={getItemSubLabel(item)}\n avatarUrl={getItemAvatarUrl(item)}\n key={getItemKey(item)}\n size={size}\n handleRemove={handleRemove}\n multiple={multiple}\n disabled={disabled || getItemDisabled(item)}\n />\n );\n };\n\n const renderValue = renderValueProp || renderValueDefault;\n\n const inputRefForRender = useForkRef([inputRef, inputRefProp]);\n\n const renderControlValue = () => {\n const width = multiple\n ? getInputWidth(controlInnerRef, helperInputFakeElement)\n : undefined;\n return (\n <>\n {isMultipleParams(props) &&\n Array.isArray(props.value) &&\n props.value.map((item) =>\n renderValue({ item, handleRemove: getHandleRemoveValue(item) }),\n )}\n {isNotMultipleParams(props) &&\n isNotNil(props.value) &&\n renderValue({ item: props.value })}\n {(!isNotNil(value) || (Array.isArray(value) && value.length === 0)) &&\n !searchValue &&\n placeholder && (\n <span className={cnSelect('Placeholder')} title=\"placeholder\">\n {placeholder}\n </span>\n )}\n <input\n {...getKeyProps()}\n type=\"text\"\n name={name}\n id={inputId}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n aria-label={ariaLabel}\n onChange={handleInputChange}\n ref={inputRefForRender}\n className={cnSelect('Input', {\n size,\n hide: !multiple && isNotNil(value),\n multiple,\n isUserSelect: true,\n })}\n value={searchValue}\n style={{ width }}\n />\n </>\n );\n };\n\n return (\n <>\n <SelectContainer\n focused={isFocused}\n disabled={disabled}\n size={size}\n required={required}\n id={inputId}\n view={view}\n type=\"userselect\"\n form={form}\n multiple\n ref={ref}\n style={style}\n {...restProps}\n >\n <div\n className={cnSelect('Control', { hasInput: true })}\n ref={controlRef}\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n id={id}\n >\n <div\n className={cnSelect('ControlInner')}\n onClick={handleInputClick}\n role=\"button\"\n ref={controlInnerRef}\n aria-hidden=\"true\"\n >\n <div className={cnSelect('ControlValueContainer')}>\n {multiple ? (\n <div\n className={cnSelect('ControlValue', { isUserSelect: true })}\n >\n {renderControlValue()}\n </div>\n ) : (\n renderControlValue()\n )}\n </div>\n </div>\n <span className={cnSelect('Indicators')}>\n {isNotNil(value) && (\n <button\n type=\"button\"\n onClick={clearValue}\n className={cnSelect('ClearIndicator', [cnMixFocus()])}\n >\n <IconClear\n size={clearSizeMap[size]}\n className={cnSelect('ClearIndicatorIcon')}\n />\n </button>\n )}\n <span className={cnSelect('Delimiter')} />\n <button\n type=\"button\"\n className={cnSelect('IndicatorsDropdown')}\n tabIndex={-1}\n onClick={handleToggleDropdown}\n >\n <IconSelect\n size={iconSizeMap[size]}\n className={cnSelect('DropdownIndicatorIcon')}\n />\n </button>\n </span>\n </div>\n <div\n className={cnSelect('HelperInputFakeElement')}\n ref={helperInputFakeElement}\n >\n {searchValue}\n </div>\n </SelectContainer>\n <SelectDropdown\n isOpen={isOpen}\n size={size}\n controlRef={controlRef}\n getOptionProps={getOptionProps}\n dropdownRef={dropdownRef}\n form={dropdownForm}\n isLoading={isLoading}\n className={dropdownClassName}\n renderItem={renderItem || renderItemDefault}\n getGroupLabel={getGroupLabel}\n visibleItems={visibleItems}\n labelForNotFound={labelForNotFound}\n labelForCreate={labelForCreate}\n notFound={notFound}\n hasItems={hasItems}\n labelForEmptyItems={labelForEmptyItems}\n style={\n typeof style?.zIndex === 'number'\n ? { zIndex: style.zIndex + 1 }\n : undefined\n }\n />\n </>\n );\n};\n\nexport const UserSelect = forwardRef(UserSelectRender) as UserSelectComponent;\n\nexport * from './helpers';\n"],"mappings":"ykBAAA,iDAEA,OAASA,SAAT,KAA0B,yBAA1B,CACA,OAASC,UAAT,KAA2B,0BAA3B,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,MAA5B,KAA0C,OAA1C,CAEA,OAASC,QAAT,+BAEA,OAASC,UAAT,yCACA,OAASC,SAAT,uCACA,OAASC,UAAT,oCACA,OAASC,YAAT,6BACA,OAASC,eAAT,2CACA,OAASC,QAAT,8CACA,OACEC,qBADF,CAEEC,yBAFF,CAGEC,uBAHF,CAIEC,aAJF,6CAMA,OAASC,eAAT,qEACA,OAASC,cAAT,mEACA,OACEC,eADF,CAEEC,eAFF,CAGEC,eAHF,2CAKA,OAGEC,WAHF,CAIEC,gBAJF,CAKEC,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AEC,CALX,CAME,IAAI,CAAE5D,CANR,CAOE,MAAM,CAAmB,OAAjB,GAAA0B,EAAY,CAAe,WAAf,CAA6B,QAPnD,CAQE,OAAO,CAAEmC,CARX,CASE,YAAY,CAAEC,CAThB,CAUE,OAAO,CAAEnD,CAAe,CAACkB,CAAD,CAV1B,CAWE,QAAQ,CAAEN,CAXZ,EAcH,CAgJG,CAUE,aAAa,CAAEV,CAVjB,CAWE,YAAY,CAAEqB,EAXhB,CAYE,gBAAgB,CAAEd,CAZpB,CAaE,cAAc,CAAEC,CAblB,CAcE,QAAQ,CAAEsB,EAdZ,CAeE,QAAQ,CAAEC,EAfZ,CAgBE,kBAAkB,CAAEtB,CAhBtB,CAiBE,KAAK,CACsB,QAAzB,gBAAOG,CAAP,WAAOA,CAAP,QAAOA,CAAK,CAAEsC,MAAd,EACI,CAAEA,MAAM,CAAEtC,CAAK,CAACsC,MAAN,CAAe,CAAzB,CADJ,OAlBJ,EA3EF,CAoGH,CApSD,CAsSA,MAAO,IAAMC,WAAU,CAAG/G,UAAU,CAAC0B,gBAAD,CAA7B,CAEP"}
|
|
1
|
+
{"version":3,"file":"UserSelectDeprecated.js","names":["IconClear","IconSelect","React","forwardRef","useRef","isNotNil","useForkRef","useSelect","cnMixFocus","clearSizeMap","usePropsHandler","cnSelect","defaultLabelForCreate","defaultLabelForEmptyItems","defaultLabelForNotFound","getInputWidth","SelectContainer","SelectDropdown","defaultPropForm","defaultPropSize","defaultPropView","iconSizeMap","isMultipleParams","isNotMultipleParams","searchCompare","withDefaultGetters","UserSelectItem","UserSelectValue","COMPONENT_NAME","UserSelectRender","props","ref","defaultDropdownRef","controlInnerRef","helperInputFakeElement","controlRef","placeholder","onBlur","onFocus","items","onChange","value","disabled","ariaLabel","id","isLoading","required","dropdownRef","form","view","size","dropdownClassName","searchValueProp","searchValue","name","groups","getItemKey","getItemLabel","getItemSubLabel","getItemAvatarUrl","getItemGroupKey","getItemDisabled","getGroupKey","getGroupLabel","renderItem","renderValueProp","renderValue","onCreate","inputRefProp","inputRef","labelForNotFound","labelForCreate","labelForEmptyItems","multiple","searchFunction","style","dropdownForm","restProps","searchFunctionDefault","item","searchOfLabel","getKeyProps","getOptionProps","isOpen","visibleItems","isFocused","handleInputFocus","handleInputBlur","handleToggleDropdown","handleInputClick","handleInputChange","clearValue","getHandleRemoveValue","notFound","hasItems","inputId","renderValueDefault","handleRemove","inputRefForRender","renderControlValue","width","Array","isArray","map","length","hide","isUserSelect","hasInput","renderItemDefault","active","hovered","onClick","onMouseEnter","zIndex","UserSelect"],"sources":["../../../../../src/components/UserSelectDeprecated/UserSelectDeprecated.tsx"],"sourcesContent":["import '../SelectComponentsDeprecated/Select.css';\n\nimport { IconClear } from '@consta/icons/IconClear';\nimport { IconSelect } from '@consta/icons/IconSelect';\nimport React, { forwardRef, useRef } from 'react';\n\nimport { isNotNil } from '##/utils/type-guards';\n\nimport { useForkRef } from '../../hooks/useForkRef/useForkRef';\nimport { useSelect } from '../../hooks/useSelect/useSelect';\nimport { cnMixFocus } from '../../mixs/MixFocus/MixFocus';\nimport { clearSizeMap } from '../ComboboxDeprecated';\nimport { usePropsHandler } from '../EventInterceptor/usePropsHandler';\nimport { cnSelect } from '../SelectComponentsDeprecated/cnSelect';\nimport {\n defaultLabelForCreate,\n defaultLabelForEmptyItems,\n defaultLabelForNotFound,\n getInputWidth,\n} from '../SelectComponentsDeprecated/helpers';\nimport { SelectContainer } from '../SelectComponentsDeprecated/SelectContainer/SelectContainer';\nimport { SelectDropdown } from '../SelectComponentsDeprecated/SelectDropdown/SelectDropdown';\nimport {\n defaultPropForm,\n defaultPropSize,\n defaultPropView,\n} from '../SelectComponentsDeprecated/types';\nimport {\n DefaultGroup,\n DefaultItem,\n iconSizeMap,\n isMultipleParams,\n isNotMultipleParams,\n PropRenderItem,\n PropRenderValue,\n searchCompare,\n UserSelectComponent,\n UserSelectProps,\n withDefaultGetters,\n} from './helpers';\nimport { UserSelectItem } from './UserSelectItem/UserSelectItem';\nimport { UserSelectValue } from './UserSelectValue/UserSelectValue';\n\nexport const COMPONENT_NAME = 'UserSelect' as const;\n\nconst UserSelectRender = <\n ITEM = DefaultItem,\n GROUP = DefaultGroup,\n MULTIPLE extends boolean = false,\n>(\n props: UserSelectProps<ITEM, GROUP, MULTIPLE>,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const defaultDropdownRef = useRef<HTMLDivElement | null>(null);\n const controlInnerRef = useRef<HTMLDivElement>(null);\n const helperInputFakeElement = useRef<HTMLDivElement>(null);\n const controlRef = useRef<HTMLDivElement | null>(null);\n\n const {\n placeholder,\n onBlur,\n onFocus,\n items,\n onChange,\n value,\n disabled,\n ariaLabel,\n id,\n isLoading,\n required,\n dropdownRef = defaultDropdownRef,\n form = defaultPropForm,\n view = defaultPropView,\n size = defaultPropSize,\n dropdownClassName,\n searchValue: searchValueProp,\n name,\n groups = [],\n getItemKey,\n getItemLabel,\n getItemSubLabel,\n getItemAvatarUrl,\n getItemGroupKey,\n getItemDisabled,\n getGroupKey,\n getGroupLabel,\n renderItem,\n renderValue: renderValueProp,\n onCreate,\n inputRef: inputRefProp,\n labelForNotFound = defaultLabelForNotFound,\n labelForCreate = defaultLabelForCreate,\n labelForEmptyItems = defaultLabelForEmptyItems,\n multiple = false,\n searchFunction,\n style,\n dropdownForm = 'default',\n ...restProps\n } = usePropsHandler(COMPONENT_NAME, withDefaultGetters(props), controlRef);\n\n const searchFunctionDefault = (item: ITEM, searchValue: string): boolean => {\n const searchOfLabel = searchCompare(searchValue, getItemLabel(item));\n\n if (searchOfLabel) {\n return searchOfLabel;\n }\n\n return searchCompare(searchValue, getItemSubLabel(item));\n };\n\n const {\n getKeyProps,\n getOptionProps,\n isOpen,\n visibleItems,\n isFocused,\n handleInputFocus,\n handleInputBlur,\n handleToggleDropdown,\n inputRef,\n handleInputClick,\n handleInputChange,\n searchValue,\n clearValue,\n getHandleRemoveValue,\n notFound,\n hasItems,\n } = useSelect({\n items,\n groups,\n value,\n onChange,\n dropdownRef,\n controlRef,\n disabled,\n getItemLabel,\n getItemKey,\n getGroupKey,\n getItemGroupKey,\n searchValue: searchValueProp,\n getItemDisabled,\n multiple,\n onBlur,\n onFocus,\n onCreate,\n searchFunction: searchFunction || searchFunctionDefault,\n });\n\n const inputId = id ? `${id}-input` : id;\n\n const renderItemDefault: PropRenderItem<ITEM> = (props) => {\n const { item, active, hovered, onClick, onMouseEnter } = props;\n\n return (\n <UserSelectItem\n label={getItemLabel(item)}\n subLabel={getItemSubLabel(item)}\n avatarUrl={getItemAvatarUrl(item)}\n active={active}\n hovered={hovered}\n size={size}\n indent={dropdownForm === 'round' ? 'increased' : 'normal'}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n disable={getItemDisabled(item)}\n multiple={multiple}\n />\n );\n };\n\n const renderValueDefault: PropRenderValue<ITEM> = ({\n item,\n handleRemove,\n }) => {\n return (\n <UserSelectValue\n label={getItemLabel(item)}\n subLabel={getItemSubLabel(item)}\n avatarUrl={getItemAvatarUrl(item)}\n key={getItemKey(item)}\n size={size}\n handleRemove={handleRemove}\n multiple={multiple}\n disabled={disabled || getItemDisabled(item)}\n />\n );\n };\n\n const renderValue = renderValueProp || renderValueDefault;\n\n const inputRefForRender = useForkRef([inputRef, inputRefProp]);\n\n const renderControlValue = () => {\n const width = multiple\n ? getInputWidth(controlInnerRef, helperInputFakeElement)\n : undefined;\n return (\n <>\n {isMultipleParams(props) &&\n Array.isArray(props.value) &&\n props.value.map((item) =>\n renderValue({ item, handleRemove: getHandleRemoveValue(item) }),\n )}\n {isNotMultipleParams(props) &&\n isNotNil(props.value) &&\n renderValue({ item: props.value })}\n {(!isNotNil(value) || (Array.isArray(value) && value.length === 0)) &&\n !searchValue &&\n placeholder && (\n <span className={cnSelect('Placeholder')} title=\"placeholder\">\n {placeholder}\n </span>\n )}\n <input\n {...getKeyProps()}\n type=\"text\"\n name={name}\n id={inputId}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n aria-label={ariaLabel}\n onChange={handleInputChange}\n ref={inputRefForRender}\n className={cnSelect('Input', {\n size,\n hide: !multiple && isNotNil(value),\n multiple,\n isUserSelect: true,\n })}\n value={searchValue}\n style={{ width }}\n />\n </>\n );\n };\n\n return (\n <>\n <SelectContainer\n focused={isFocused}\n disabled={disabled}\n size={size}\n required={required}\n id={inputId}\n view={view}\n type=\"userselect\"\n form={form}\n multiple\n ref={ref}\n style={style}\n {...restProps}\n >\n <div\n className={cnSelect('Control', { hasInput: true })}\n ref={controlRef}\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n id={id}\n >\n <div\n className={cnSelect('ControlInner')}\n onClick={handleInputClick}\n role=\"button\"\n ref={controlInnerRef}\n aria-hidden=\"true\"\n >\n <div className={cnSelect('ControlValueContainer')}>\n {multiple ? (\n <div\n className={cnSelect('ControlValue', { isUserSelect: true })}\n >\n {renderControlValue()}\n </div>\n ) : (\n renderControlValue()\n )}\n </div>\n </div>\n <span className={cnSelect('Indicators')}>\n {isNotNil(value) && (\n <button\n type=\"button\"\n onClick={clearValue}\n className={cnSelect('ClearIndicator', [cnMixFocus()])}\n >\n <IconClear\n size={clearSizeMap[size]}\n className={cnSelect('ClearIndicatorIcon')}\n />\n </button>\n )}\n <span className={cnSelect('Delimiter')} />\n <button\n type=\"button\"\n className={cnSelect('IndicatorsDropdown')}\n tabIndex={-1}\n onClick={handleToggleDropdown}\n >\n <IconSelect\n size={iconSizeMap[size]}\n className={cnSelect('DropdownIndicatorIcon')}\n />\n </button>\n </span>\n </div>\n <div\n className={cnSelect('HelperInputFakeElement')}\n ref={helperInputFakeElement}\n >\n {searchValue}\n </div>\n </SelectContainer>\n <SelectDropdown\n isOpen={isOpen}\n size={size}\n controlRef={controlRef}\n getOptionProps={getOptionProps}\n dropdownRef={dropdownRef}\n form={dropdownForm}\n isLoading={isLoading}\n className={dropdownClassName}\n renderItem={renderItem || renderItemDefault}\n getGroupLabel={getGroupLabel}\n visibleItems={visibleItems}\n labelForNotFound={labelForNotFound}\n labelForCreate={labelForCreate}\n notFound={notFound}\n hasItems={hasItems}\n labelForEmptyItems={labelForEmptyItems}\n style={\n typeof style?.zIndex === 'number'\n ? { zIndex: style.zIndex + 1 }\n : undefined\n }\n />\n </>\n );\n};\n\nexport const UserSelect = forwardRef(UserSelectRender) as UserSelectComponent;\n\nexport * from './helpers';\n"],"mappings":"ykBAAA,iDAEA,OAASA,SAAT,KAA0B,yBAA1B,CACA,OAASC,UAAT,KAA2B,0BAA3B,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,MAA5B,KAA0C,OAA1C,CAEA,OAASC,QAAT,+BAEA,OAASC,UAAT,yCACA,OAASC,SAAT,uCACA,OAASC,UAAT,oCACA,OAASC,YAAT,6BACA,OAASC,eAAT,2CACA,OAASC,QAAT,8CACA,OACEC,qBADF,CAEEC,yBAFF,CAGEC,uBAHF,CAIEC,aAJF,6CAMA,OAASC,eAAT,qEACA,OAASC,cAAT,mEACA,OACEC,eADF,CAEEC,eAFF,CAGEC,eAHF,2CAKA,OAGEC,WAHF,CAIEC,gBAJF,CAKEC,mBALF,CAQEC,aARF,CAWEC,kBAXF,iBAaA,OAASC,cAAT,uCACA,OAASC,eAAT,yCAEA,MAAO,IAAMC,eAAc,CAAG,YAAvB,CAEP,GAAMC,iBAAgB,CAAG,SAKvBC,CALuB,CAMvBC,CANuB,CAOpB,IACGC,EAAkB,CAAG5B,MAAM,CAAwB,IAAxB,CAD9B,CAEG6B,CAAe,CAAG7B,MAAM,CAAiB,IAAjB,CAF3B,CAGG8B,CAAsB,CAAG9B,MAAM,CAAiB,IAAjB,CAHlC,CAIG+B,CAAU,CAAG/B,MAAM,CAAwB,IAAxB,CAJtB,GA8CCM,eAAe,CAACkB,cAAD,CAAiBH,kBAAkB,CAACK,CAAD,CAAnC,CAA4CK,CAA5C,CA9ChB,CAODC,CAPC,GAODA,WAPC,CAQDC,CARC,GAQDA,MARC,CASDC,CATC,GASDA,OATC,CAUDC,CAVC,GAUDA,KAVC,CAWDC,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e,CAAzB,CADJ,OAlBJ,EA3EF,CAoGH,CApSD,CAsSA,MAAO,IAAMC,WAAU,CAAG/G,UAAU,CAAC0B,gBAAD,CAA7B,CAEP"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","label","subLabel","avatarUrl","active","hovered","size","indent","disable","multiple"];import"./UserSelectItem.css";import{IconCheck}from"@consta/icons/IconCheck";import React,{useRef}from"react";import{Transition}from"react-transition-group";import{Avatar}from"../../Avatar/Avatar";import{
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","label","subLabel","avatarUrl","active","hovered","size","indent","disable","multiple"];import"./UserSelectItem.css";import{IconCheck}from"@consta/icons/IconCheck";import React,{useRef}from"react";import{Transition}from"react-transition-group";import{Avatar}from"../../Avatar/Avatar";import{mapHorizontalSpace,mapHorizontalSpaceIncreased,mapItemVerticalPadding}from"../../ListCanary";import{cnMixSpace}from"../../../mixs/MixSpace";import{cn}from"../../../utils/bem";export var cnUserSelectItem=cn("UserSelectItem");export var UserSelectItem=function(a){var b=a.className,c=a.label,d=a.subLabel,e=a.avatarUrl,f=a.active,g=a.hovered,h=a.size,i=a.indent,j=a.disable,k=a.multiple,l=_objectWithoutProperties(a,_excluded),m=useRef(null);return React.createElement("div",Object.assign({},l,{className:cnUserSelectItem({active:f,hovered:g,size:h,indent:i,disable:j},[cnMixSpace({pH:"increased"===i?mapHorizontalSpaceIncreased[h]:mapHorizontalSpace[h],pV:mapItemVerticalPadding[h]}),b]),"aria-selected":f,role:"option"}),React.createElement("div",{className:cnUserSelectItem("AvatarContainer")},React.createElement(Avatar,{className:cnUserSelectItem("Avatar"),url:e,name:c}),k&&React.createElement(Transition,{in:f,unmountOnExit:!0,timeout:200,nodeRef:m},function(a){return React.createElement(IconCheck,{className:cnUserSelectItem("CheckIcon",{animate:a}),ref:m})}),!k&&f&&React.createElement(IconCheck,{className:cnUserSelectItem("CheckIcon")})),d?React.createElement("div",{className:cnUserSelectItem("Info")},React.createElement("div",null,c),React.createElement("div",{className:cnUserSelectItem("SubLabel",{disable:j})},d)):React.createElement("div",{className:cnUserSelectItem("Info")},c))};
|
|
2
2
|
//# sourceMappingURL=UserSelectItem.js.map
|
package/__internal__/src/components/UserSelectDeprecated/UserSelectItem/UserSelectItem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserSelectItem.js","names":["IconCheck","React","useRef","Transition","Avatar","
|
|
1
|
+
{"version":3,"file":"UserSelectItem.js","names":["IconCheck","React","useRef","Transition","Avatar","mapHorizontalSpace","mapHorizontalSpaceIncreased","mapItemVerticalPadding","cnMixSpace","cn","cnUserSelectItem","UserSelectItem","props","className","label","subLabel","avatarUrl","active","hovered","size","indent","disable","multiple","otherProps","iconRef","pH","pV","animate"],"sources":["../../../../../../src/components/UserSelectDeprecated/UserSelectItem/UserSelectItem.tsx"],"sourcesContent":["import './UserSelectItem.css';\n\nimport { IconCheck } from '@consta/icons/IconCheck';\nimport React, { useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport { Avatar } from '##/components/Avatar/Avatar';\nimport {\n mapHorizontalSpace,\n mapHorizontalSpaceIncreased,\n mapItemVerticalPadding,\n} from '##/components/ListCanary';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\nimport { PropsWithHTMLAttributes } from '##/utils/types/PropsWithHTMLAttributes';\n\ntype UserSelectItemProps = PropsWithHTMLAttributes<\n {\n label: string;\n active: boolean;\n hovered: boolean;\n size: 's' | 'm' | 'l';\n indent: 'normal' | 'increased';\n subLabel?: string;\n avatarUrl?: string;\n disable?: boolean;\n multiple?: boolean;\n },\n HTMLDivElement\n>;\n\nexport const cnUserSelectItem = cn('UserSelectItem');\n\nexport const UserSelectItem: React.FC<UserSelectItemProps> = (props) => {\n const {\n className,\n label,\n subLabel,\n avatarUrl,\n active,\n hovered,\n size,\n indent,\n disable,\n multiple,\n ...otherProps\n } = props;\n\n const iconRef = useRef<HTMLSpanElement>(null);\n\n return (\n <div\n {...otherProps}\n className={cnUserSelectItem({ active, hovered, size, indent, disable }, [\n cnMixSpace({\n pH:\n indent === 'increased'\n ? mapHorizontalSpaceIncreased[size]\n : mapHorizontalSpace[size],\n pV: mapItemVerticalPadding[size],\n }),\n className,\n ])}\n aria-selected={active}\n role=\"option\"\n >\n <div className={cnUserSelectItem('AvatarContainer')}>\n <Avatar\n className={cnUserSelectItem('Avatar')}\n url={avatarUrl}\n name={label}\n />\n {multiple && (\n <Transition in={active} unmountOnExit timeout={200} nodeRef={iconRef}>\n {(animate) => (\n <IconCheck\n className={cnUserSelectItem('CheckIcon', { animate })}\n ref={iconRef}\n />\n )}\n </Transition>\n )}\n {!multiple && active && (\n <IconCheck className={cnUserSelectItem('CheckIcon')} />\n )}\n </div>\n {!subLabel ? (\n <div className={cnUserSelectItem('Info')}>{label}</div>\n ) : (\n <div className={cnUserSelectItem('Info')}>\n <div>{label}</div>\n <div className={cnUserSelectItem('SubLabel', { disable })}>\n {subLabel}\n </div>\n </div>\n )}\n </div>\n );\n};\n"],"mappings":"wMAAA,6BAEA,OAASA,SAAT,KAA0B,yBAA1B,CACA,MAAOC,MAAP,EAAgBC,MAAhB,KAA8B,OAA9B,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAEA,OAASC,MAAT,2BACA,OACEC,kBADF,CAEEC,2BAFF,CAGEC,sBAHF,wBAKA,OAASC,UAAT,8BACA,OAASC,EAAT,0BAkBA,MAAO,IAAMC,iBAAgB,CAAGD,EAAE,CAAC,gBAAD,CAA3B,CAEP,MAAO,IAAME,eAA6C,CAAG,SAACC,CAAD,CAAW,IAEpEC,EAFoE,CAalED,CAbkE,CAEpEC,SAFoE,CAGpEC,CAHoE,CAalEF,CAbkE,CAGpEE,KAHoE,CAIpEC,CAJoE,CAalEH,CAbkE,CAIpEG,QAJoE,CAKpEC,CALoE,CAalEJ,CAbk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,CAAF,CAAd,CAD7B,CAEE,GAAG,CAAEH,CAFP,EADD,CADH,CAPJ,CAgBG,CAACF,CAAD,EAAaL,CAAb,EACC,oBAAC,SAAD,EAAW,SAAS,CAAEP,gBAAgB,CAAC,WAAD,CAAtC,EAjBJ,CAfF,CAmCIK,CAAD,CAGC,2BAAK,SAAS,CAAEL,gBAAgB,CAAC,MAAD,CAAhC,EACE,+BAAMI,CAAN,CADF,CAEE,2BAAK,SAAS,CAAEJ,gBAAgB,CAAC,UAAD,CAAa,CAAEW,OAAO,CAAPA,CAAF,CAAb,CAAhC,EACGN,CADH,CAFF,CAHD,CACC,2BAAK,SAAS,CAAEL,gBAAgB,CAAC,MAAD,CAAhC,EAA2CI,CAA3C,CApCJ,CA+CH,CAjEM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTooltip.js","names":["React","useCallback","useRef","Tooltip","useDebounce","useFlag","useForkRef","useMutableRef","withTooltipPropMode","withTooltipPropModeDefault","appearTimeoutDefault","exitTimeoutDefault","withTooltip","hocProps","Component","forwardRef","props","ref","tooltipProps","componentProps","mode","tooltipContent","content","closeOnClickOutside","appearTimeout","exitTimeout","otherTooltipProps","resultContent","visible","setVisible","anchorRef","hoverStateRef","tooltip","anchor","mutablePropsRef","onMouseEnter","onMouseLeave","onClick","mouseEnterController","current","on","mouseLeaveController","off","anchorOnMouseEnter","e","anchorOnMouseLeave","tooltipOnMouseEnter","tooltipOnMouseLeave","tooltipOnClickOutside","anchorOnClick","toggle","className"],"sources":["../../../../../src/hocs/withTooltip/withTooltip.tsx"],"sourcesContent":["import React, { useCallback, useRef } from 'react';\n\nimport {\n Tooltip,\n TooltipProps as TooltipComponentProps,\n} from '##/components/Tooltip';\nimport { useDebounce } from '##/hooks/useDebounce';\nimport { useFlag } from '##/hooks/useFlag';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { useMutableRef } from '##/hooks/useMutableRef';\n\nexport const withTooltipPropMode = ['mouseover', 'click'] as const;\nexport const withTooltipPropModeDefault = withTooltipPropMode[0];\ntype WithTooltipPropMode = typeof withTooltipPropMode[number];\n\nexport const appearTimeoutDefault = 400;\nexport const exitTimeoutDefault = 200;\n\ntype ComponentProps = {\n onClick?: React.MouseEventHandler;\n onMouseEnter?: React.MouseEventHandler;\n onMouseLeave?: React.MouseEventHandler;\n};\n\nexport type TooltipProps = Omit<TooltipComponentProps, 'children' | 'ref'> & {\n tooltipContent?: React.ReactNode;\n /** @deprecated use tooltipContent */\n content?: React.ReactNode;\n mode?: WithTooltipPropMode;\n closeOnClickOutside?: boolean;\n appearTimeout?: number;\n exitTimeout?: number;\n};\n\nexport type WithTooltipProps<Props> = Omit<Props, 'tooltipProps'> & {\n tooltipProps?: TooltipProps;\n};\n\ntype HoverState = {\n tooltip: boolean;\n anchor: boolean;\n};\n\nexport function withTooltip(hocProps?: TooltipProps) {\n return function <COMPONENT_TYPE, COMPONENT_PROPS extends ComponentProps>(\n Component: COMPONENT_TYPE,\n ) {\n return React.forwardRef<HTMLElement, WithTooltipProps<COMPONENT_PROPS>>(\n (props, ref) => {\n const { tooltipProps = {}, ...componentProps } = props;\n\n const {\n mode = 'mouseover',\n tooltipContent,\n content,\n closeOnClickOutside = true,\n appearTimeout = appearTimeoutDefault,\n exitTimeout = exitTimeoutDefault,\n ...otherTooltipProps\n } = {\n ...hocProps,\n ...tooltipProps,\n };\n\n const resultContent = tooltipContent ?? content;\n\n const [visible, setVisible] = useFlag();\n const anchorRef = useRef<HTMLElement>(null);\n\n const hoverStateRef = useRef<HoverState>({\n tooltip: false,\n anchor: false,\n });\n\n const mutablePropsRef = useMutableRef([\n componentProps.onMouseEnter,\n componentProps.onMouseLeave,\n otherTooltipProps.onMouseEnter,\n otherTooltipProps.onMouseLeave,\n componentProps.onClick,\n mode,\n closeOnClickOutside,\n ] as const);\n\n const mouseEnterController = useDebounce(\n useCallback(() => {\n mutablePropsRef.current[5] === 'mouseover' &&\n (hoverStateRef.current.anchor || hoverStateRef.current.tooltip) &&\n setVisible.on();\n }, []),\n appearTimeout,\n );\n\n const mouseLeaveController = useDebounce(\n useCallback(() => {\n mutablePropsRef.current[5] === 'mouseover' &&\n !hoverStateRef.current.anchor &&\n !hoverStateRef.current.tooltip &&\n setVisible.off();\n }, []),\n exitTimeout,\n );\n\n const anchorOnMouseEnter: React.MouseEventHandler<HTMLDivElement> =\n useCallback((e) => {\n hoverStateRef.current.anchor = true;\n mouseEnterController();\n mutablePropsRef.current[0]?.(e);\n }, []);\n\n const anchorOnMouseLeave: React.MouseEventHandler<HTMLDivElement> =\n useCallback((e) => {\n hoverStateRef.current.anchor = false;\n mouseLeaveController();\n mutablePropsRef.current[1]?.(e);\n }, []);\n\n const tooltipOnMouseEnter: React.MouseEventHandler<HTMLDivElement> =\n useCallback((e) => {\n hoverStateRef.current.tooltip = true;\n mouseEnterController();\n mutablePropsRef.current[2]?.(e);\n }, []);\n\n const tooltipOnMouseLeave: React.MouseEventHandler<HTMLDivElement> =\n useCallback((e) => {\n hoverStateRef.current.tooltip = false;\n mouseLeaveController();\n mutablePropsRef.current[3]?.(e);\n }, []);\n\n const tooltipOnClickOutside = useCallback(() => {\n mutablePropsRef.current[5] === 'click' &&\n mutablePropsRef.current[6] &&\n setVisible.off();\n }, [mode, closeOnClickOutside]);\n\n const anchorOnClick: React.MouseEventHandler = useCallback((e) => {\n mutablePropsRef.current[5] === 'click' && setVisible.toggle();\n mutablePropsRef.current[4]?.(e);\n }, []);\n\n const Anchor =\n Component as unknown as React.ComponentType<COMPONENT_PROPS>;\n\n return (\n <>\n <Anchor\n {...(componentProps as COMPONENT_PROPS)}\n onClick={anchorOnClick}\n onMouseEnter={anchorOnMouseEnter}\n onMouseLeave={anchorOnMouseLeave}\n ref={useForkRef([anchorRef, ref])}\n />\n <Tooltip\n {...otherTooltipProps}\n isOpen={visible && !!resultContent}\n className={otherTooltipProps.className}\n anchorRef={anchorRef}\n onClickOutside={tooltipOnClickOutside}\n onMouseEnter={tooltipOnMouseEnter}\n onMouseLeave={tooltipOnMouseLeave}\n >\n {resultContent}\n </Tooltip>\n </>\n );\n // привел к типам, так как прокинутый компонент может иметь
|
|
1
|
+
{"version":3,"file":"withTooltip.js","names":["React","useCallback","useRef","Tooltip","useDebounce","useFlag","useForkRef","useMutableRef","withTooltipPropMode","withTooltipPropModeDefault","appearTimeoutDefault","exitTimeoutDefault","withTooltip","hocProps","Component","forwardRef","props","ref","tooltipProps","componentProps","mode","tooltipContent","content","closeOnClickOutside","appearTimeout","exitTimeout","otherTooltipProps","resultContent","visible","setVisible","anchorRef","hoverStateRef","tooltip","anchor","mutablePropsRef","onMouseEnter","onMouseLeave","onClick","mouseEnterController","current","on","mouseLeaveController","off","anchorOnMouseEnter","e","anchorOnMouseLeave","tooltipOnMouseEnter","tooltipOnMouseLeave","tooltipOnClickOutside","anchorOnClick","toggle","className"],"sources":["../../../../../src/hocs/withTooltip/withTooltip.tsx"],"sourcesContent":["import React, { useCallback, useRef } from 'react';\n\nimport {\n Tooltip,\n TooltipProps as TooltipComponentProps,\n} from '##/components/Tooltip';\nimport { useDebounce } from '##/hooks/useDebounce';\nimport { useFlag } from '##/hooks/useFlag';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { useMutableRef } from '##/hooks/useMutableRef';\n\nexport const withTooltipPropMode = ['mouseover', 'click'] as const;\nexport const withTooltipPropModeDefault = withTooltipPropMode[0];\ntype WithTooltipPropMode = typeof withTooltipPropMode[number];\n\nexport const appearTimeoutDefault = 400;\nexport const exitTimeoutDefault = 200;\n\ntype ComponentProps = {\n onClick?: React.MouseEventHandler;\n onMouseEnter?: React.MouseEventHandler;\n onMouseLeave?: React.MouseEventHandler;\n};\n\nexport type TooltipProps = Omit<TooltipComponentProps, 'children' | 'ref'> & {\n tooltipContent?: React.ReactNode;\n /** @deprecated use tooltipContent */\n content?: React.ReactNode;\n mode?: WithTooltipPropMode;\n closeOnClickOutside?: boolean;\n appearTimeout?: number;\n exitTimeout?: number;\n};\n\nexport type WithTooltipProps<Props> = Omit<Props, 'tooltipProps'> & {\n tooltipProps?: TooltipProps;\n};\n\ntype HoverState = {\n tooltip: boolean;\n anchor: boolean;\n};\n\nexport function withTooltip(hocProps?: TooltipProps) {\n return function <COMPONENT_TYPE, COMPONENT_PROPS extends ComponentProps>(\n Component: COMPONENT_TYPE,\n ) {\n return React.forwardRef<HTMLElement, WithTooltipProps<COMPONENT_PROPS>>(\n (props, ref) => {\n const { tooltipProps = {}, ...componentProps } = props;\n\n const {\n mode = 'mouseover',\n tooltipContent,\n content,\n closeOnClickOutside = true,\n appearTimeout = appearTimeoutDefault,\n exitTimeout = exitTimeoutDefault,\n ...otherTooltipProps\n } = {\n ...hocProps,\n ...tooltipProps,\n };\n\n const resultContent = tooltipContent ?? content;\n\n const [visible, setVisible] = useFlag();\n const anchorRef = useRef<HTMLElement>(null);\n\n const hoverStateRef = useRef<HoverState>({\n tooltip: false,\n anchor: false,\n });\n\n const mutablePropsRef = useMutableRef([\n componentProps.onMouseEnter,\n componentProps.onMouseLeave,\n otherTooltipProps.onMouseEnter,\n otherTooltipProps.onMouseLeave,\n componentProps.onClick,\n mode,\n closeOnClickOutside,\n ] as const);\n\n const mouseEnterController = useDebounce(\n useCallback(() => {\n mutablePropsRef.current[5] === 'mouseover' &&\n (hoverStateRef.current.anchor || hoverStateRef.current.tooltip) &&\n setVisible.on();\n }, []),\n appearTimeout,\n );\n\n const mouseLeaveController = useDebounce(\n useCallback(() => {\n mutablePropsRef.current[5] === 'mouseover' &&\n !hoverStateRef.current.anchor &&\n !hoverStateRef.current.tooltip &&\n setVisible.off();\n }, []),\n exitTimeout,\n );\n\n const anchorOnMouseEnter: React.MouseEventHandler<HTMLDivElement> =\n useCallback((e) => {\n hoverStateRef.current.anchor = true;\n mouseEnterController();\n mutablePropsRef.current[0]?.(e);\n }, []);\n\n const anchorOnMouseLeave: React.MouseEventHandler<HTMLDivElement> =\n useCallback((e) => {\n hoverStateRef.current.anchor = false;\n mouseLeaveController();\n mutablePropsRef.current[1]?.(e);\n }, []);\n\n const tooltipOnMouseEnter: React.MouseEventHandler<HTMLDivElement> =\n useCallback((e) => {\n hoverStateRef.current.tooltip = true;\n mouseEnterController();\n mutablePropsRef.current[2]?.(e);\n }, []);\n\n const tooltipOnMouseLeave: React.MouseEventHandler<HTMLDivElement> =\n useCallback((e) => {\n hoverStateRef.current.tooltip = false;\n mouseLeaveController();\n mutablePropsRef.current[3]?.(e);\n }, []);\n\n const tooltipOnClickOutside = useCallback(() => {\n mutablePropsRef.current[5] === 'click' &&\n mutablePropsRef.current[6] &&\n setVisible.off();\n }, [mode, closeOnClickOutside]);\n\n const anchorOnClick: React.MouseEventHandler = useCallback((e) => {\n mutablePropsRef.current[5] === 'click' && setVisible.toggle();\n mutablePropsRef.current[4]?.(e);\n }, []);\n\n const Anchor =\n Component as unknown as React.ComponentType<COMPONENT_PROPS>;\n\n return (\n <>\n <Anchor\n {...(componentProps as COMPONENT_PROPS)}\n onClick={anchorOnClick}\n onMouseEnter={anchorOnMouseEnter}\n onMouseLeave={anchorOnMouseLeave}\n ref={useForkRef([anchorRef, ref])}\n />\n <Tooltip\n {...otherTooltipProps}\n isOpen={visible && !!resultContent}\n className={otherTooltipProps.className}\n anchorRef={anchorRef}\n onClickOutside={tooltipOnClickOutside}\n onMouseEnter={tooltipOnMouseEnter}\n onMouseLeave={tooltipOnMouseLeave}\n >\n {resultContent}\n </Tooltip>\n </>\n );\n // привел к типам, так как прокинутый компонент может иметь дженерики и они потеряются за хоком\n },\n ) as unknown as\n | COMPONENT_TYPE\n | React.ComponentType<{\n tooltipProps?: TooltipProps;\n }>;\n };\n}\n"],"mappings":"67BAAA,MAAOA,MAAP,EAAgBC,WAAhB,CAA6BC,MAA7B,KAA2C,OAA3C,CAEA,OACEC,OADF,gCAIA,OAASC,WAAT,+BACA,OAASC,OAAT,2BACA,OAASC,UAAT,8BACA,OAASC,aAAT,iCAEA,MAAO,IAAMC,oBAAmB,CAAG,CAAC,WAAD,CAAc,OAAd,CAA5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WAGjB,GAAAP,CAAe,CAACK,OAAhB,EAAwB,CAAxB,CAHiB,qBAGjB,SAA6BK,CAA7B,CACD,CAJU,CAIR,EAJQ,CA7EC,CAmFRI,CAAqB,CAAG/C,WAAW,CAAC,UAAM,CACf,OAA/B,GAAAiC,CAAe,CAACK,OAAhB,CAAwB,CAAxB,GACEL,CAAe,CAACK,OAAhB,CAAwB,CAAxB,CADF,EAEEV,CAAU,CAACa,GAAX,EACH,CAJwC,CAItC,CAACtB,CAAD,CAAOG,CAAP,CAJsC,CAnF3B,CAyFR0B,CAAsC,CAAGhD,WAAW,CAAC,SAAC2C,CAAD,CAAO,SACjC,OAA/B,GAAAV,CAAe,CAACK,OAAhB,CAAwB,CAAxB,GAA0CV,CAAU,CAACqB,MAAX,EADsB,WAEhE,GAAAhB,CAAe,CAACK,OAAhB,EAAwB,CAAxB,CAFgE,qBAEhE,SAA6BK,CAA7B,CACD,CAHyD,CAGvD,EAHuD,CAzF5C,CAiGd,MACE,yCACE,oBAJF9B,CAIE,kBACOK,CADP,EAEE,OAAO,CAAE8B,CAFX,CAGE,YAAY,CAAEN,CAHhB,CAIE,YAAY,CAAEE,CAJhB,CAKE,GAAG,CAAEvC,UAAU,CAAC,CAACwB,CAAD,CAAYb,CAAZ,CAAD,CALjB,GADF,CAQE,oBAAC,OAAD,kBACMS,CADN,EAEE,MAAM,CAAEE,CAAO,EAAI,CAAC,CAACD,CAFvB,CAGE,SAAS,CAAED,CAAiB,CAACyB,SAH/B,CAIE,SAAS,CAAErB,CAJb,CAKE,cAAc,CAAEkB,CALlB,CAME,YAAY,CAAEF,CANhB,CAOE,YAAY,CAAEC,CAPhB,GASGpB,CATH,CARF,CAsBH,CAzHI,CA+HR,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addPrefix.js","names":["firstLetterUppercase","string","charAt","toUpperCase","slice","toLowerCase","addPrefix","breakpoints","key","prefix","keys","Object","mods","index","length"],"sources":["../../../../../src/hooks/
|
|
1
|
+
{"version":3,"file":"addPrefix.js","names":["firstLetterUppercase","string","charAt","toUpperCase","slice","toLowerCase","addPrefix","breakpoints","key","prefix","keys","Object","mods","index","length"],"sources":["../../../../../src/hooks/useBreakpointsDeprecated/addPrefix.ts"],"sourcesContent":["const firstLetterUppercase = (string: string) =>\n string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();\n\nexport const addPrefix = (\n breakpoints: Record<string, boolean>,\n prefix = 'breakpoint',\n) => {\n const keys = Object.keys(breakpoints);\n const mods: Record<string, boolean> = {};\n for (let index = 0; index < keys.length; index++) {\n const key = keys[index];\n mods[`${prefix}${firstLetterUppercase(key)}`] = breakpoints[key];\n }\n return mods;\n};\n"],"mappings":"AAAA,GAAMA,qBAAoB,CAAG,SAACC,CAAD,QAC3BA,EAAM,CAACC,MAAP,CAAc,CAAd,EAAiBC,WAAjB,GAAiCF,CAAM,CAACG,KAAP,CAAa,CAAb,EAAgBC,WAAhB,EADN,CAA7B,CAGA,MAAO,IAAMC,UAAS,CAAG,SACvBC,CADuB,CAGpB,CAGH,OACQC,EADR,CAJAC,CAIA,wDAJS,YAIT,CAFMC,CAAI,CAAGC,MAAM,CAACD,IAAP,CAAYH,CAAZ,CAEb,CADMK,CAA6B,CAAG,EACtC,CAASC,CAAK,CAAG,CAAjB,CAAoBA,CAAK,CAAGH,CAAI,CAACI,MAAjC,CAAyCD,CAAK,EAA9C,CACQL,CADR,CACcE,CAAI,CAACG,CAAD,CADlB,CAEED,CAAI,WAAIH,CAAJ,SAAaT,oBAAoB,CAACQ,CAAD,CAAjC,EAAJ,CAAgDD,CAAW,CAACC,CAAD,CAF7D,CAIA,MAAOI,EACR,CAXM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLastPoint.js","names":["getLastPoint","map","keys","Object","index","length"],"sources":["../../../../../src/hooks/
|
|
1
|
+
{"version":3,"file":"getLastPoint.js","names":["getLastPoint","map","keys","Object","index","length"],"sources":["../../../../../src/hooks/useBreakpointsDeprecated/getLastPoint.ts"],"sourcesContent":["export const getLastPoint = <POINT extends string>(\n map: Record<POINT, boolean>,\n) => {\n const keys = Object.keys(map) as POINT[];\n\n for (let index = keys.length - 1; index >= 0; index--) {\n if (map[keys[index]]) {\n return keys[index];\n }\n }\n};\n"],"mappings":"AAAA,MAAO,IAAMA,aAAY,CAAG,SAC1BC,CAD0B,CAEvB,CAGH,OAFMC,EAAI,CAAGC,MAAM,CAACD,IAAP,CAAYD,CAAZ,CAEb,CAASG,CAAK,CAAGF,CAAI,CAACG,MAAL,CAAc,CAA/B,CAA2C,CAAT,EAAAD,CAAlC,CAA8CA,CAAK,EAAnD,CACE,GAAIH,CAAG,CAACC,CAAI,CAACE,CAAD,CAAL,CAAP,CACE,MAAOF,EAAI,CAACE,CAAD,CAGhB,CAVM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/hooks/useBreakpointsDeprecated/index.ts"],"sourcesContent":["export * from './useBreakpointsDeprecated';\nexport * from './getLastPoint';\nexport * from './addPrefix';\n"],"mappings":"AAAA,wCACA,4BACA"}
|
package/__internal__/src/hooks/{useBreakpointsDepricated → useBreakpointsDeprecated}/mapping.js.map
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapping.js","names":["sortMap","map","Object","fromEntries","entries","sort","a","b","mapping","width","points","key","prototype","hasOwnProperty","call"],"sources":["../../../../../src/hooks/
|
|
1
|
+
{"version":3,"file":"mapping.js","names":["sortMap","map","Object","fromEntries","entries","sort","a","b","mapping","width","points","key","prototype","hasOwnProperty","call"],"sources":["../../../../../src/hooks/useBreakpointsDeprecated/mapping.ts"],"sourcesContent":["import { Map, Returned } from './types';\n\nexport const sortMap = <POINTS extends string>(map: Map<POINTS>) =>\n Object.fromEntries(\n (Object.entries(map) as [string, number][]).sort((a, b) => a[1] - b[1]),\n ) as Map<POINTS>;\n\nexport const mapping = <POINTS extends string>(\n width: number,\n map: Map<POINTS>,\n): Returned<POINTS> => {\n const points = {} as Returned<POINTS>;\n\n for (const key in sortMap(map)) {\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n points[key] = width >= map[key];\n }\n }\n\n return points;\n};\n"],"mappings":"AAEA,MAAO,IAAMA,QAAO,CAAG,SAAwBC,CAAxB,QACrBC,OAAM,CAACC,WAAP,CACGD,MAAM,CAACE,OAAP,CAAeH,CAAf,CAAD,CAA4CI,IAA5C,CAAiD,SAACC,CAAD,CAAIC,CAAJ,QAAUD,EAAC,CAAC,CAAD,CAAD,CAAOC,CAAC,CAAC,CAAD,CAAlB,CAAjD,CADF,CADqB,CAAhB,CAKP,MAAO,IAAMC,QAAO,CAAG,SACrBC,CADqB,CAErBR,CAFqB,CAGA,CACrB,GAAMS,EAAM,CAAG,EAAf,CAEA,IAAK,GAAMC,EAAX,GAAkBX,QAAO,CAACC,CAAD,CAAzB,CACMC,MAAM,CAACU,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCb,CAArC,CAA0CU,CAA1C,CADN,GAEID,CAAM,CAACC,CAAD,CAAN,CAAcF,CAAK,EAAIR,CAAG,CAACU,CAAD,CAF9B,EAMA,MAAOD,EACR,CAbM"}
|
package/__internal__/src/hooks/{useBreakpointsDepricated → useBreakpointsDeprecated}/types.js.map
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/hooks/
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/hooks/useBreakpointsDeprecated/types.ts"],"sourcesContent":["export type Map<POINTS extends string> = Record<POINTS, number>;\nexport type Returned<POINTS extends string> = Record<POINTS, boolean>;\n"],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{useLayoutEffect,useState}from"react";import{isEq}from"../../utils/object";import{mapping}from"./mapping";var defaultPoints=["5xs","4xs","3xs","2xs","xs","s","m","l","xl","2xl","3xl","4xl","5xl"],defaultMap={"5xs":320,"4xs":360,"3xs":480,"2xs":720,xs:960,s:1020,m:1200,l:1400,xl:1600,"2xl":1800,"3xl":2e3,"4xl":2200,"5xl":2400};export var useBreakpoints=function(a){var b=a||defaultMap,c=useState(function(){return mapping(window.innerWidth,b)}),d=_slicedToArray(c,2),e=d[0],f=d[1];return useLayoutEffect(function(){var a=function(){var a=mapping(window.innerWidth,b);f(function(b){return isEq(b,a)?b:a})};return window.addEventListener("resize",a),function(){return window.removeEventListener("resize",a)}},[]),e};
|
|
2
|
+
//# sourceMappingURL=useBreakpointsDeprecated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBreakpointsDeprecated.js","names":["useLayoutEffect","useState","isEq","mapping","defaultPoints","defaultMap","useBreakpoints","map","pointsMap","window","innerWidth","points","setPoints","subscribe","newPoints","state","addEventListener","removeEventListener"],"sources":["../../../../../src/hooks/useBreakpointsDeprecated/useBreakpointsDeprecated.ts"],"sourcesContent":["import { useLayoutEffect, useState } from 'react';\n\nimport { isEq } from '##/utils/object';\n\nimport { mapping } from './mapping';\nimport { Map, Returned } from './types';\n\nconst defaultPoints = [\n '5xs',\n '4xs',\n '3xs',\n '2xs',\n 'xs',\n 's',\n 'm',\n 'l',\n 'xl',\n '2xl',\n '3xl',\n '4xl',\n '5xl',\n] as const;\n\ntype DefaultPoints = typeof defaultPoints[number];\n\nconst defaultMap: Map<DefaultPoints> = {\n '5xs': 320,\n '4xs': 360,\n '3xs': 480,\n '2xs': 720,\n 'xs': 960,\n 's': 1020,\n 'm': 1200,\n 'l': 1400,\n 'xl': 1600,\n '2xl': 1800,\n '3xl': 2000,\n '4xl': 2200,\n '5xl': 2400,\n};\n\nexport const useBreakpoints = <POINTS extends string = DefaultPoints>(\n map?: Map<POINTS>,\n) => {\n const pointsMap = map || (defaultMap as Map<POINTS>);\n\n const [points, setPoints] = useState<Returned<POINTS>>(() =>\n mapping(window.innerWidth, pointsMap),\n );\n\n useLayoutEffect(() => {\n const subscribe = () => {\n const newPoints = mapping(window.innerWidth, pointsMap);\n\n setPoints((state) => (isEq(state, newPoints) ? state : newPoints));\n };\n\n window.addEventListener('resize', subscribe);\n\n return () => window.removeEventListener('resize', subscribe);\n }, []);\n\n return points;\n};\n"],"mappings":"iEAAA,OAASA,eAAT,CAA0BC,QAA1B,KAA0C,OAA1C,CAEA,OAASC,IAAT,0BAEA,OAASC,OAAT,iB,GAGMC,cAAa,CAAG,CACpB,KADoB,CAEpB,KAFoB,CAGpB,KAHoB,CAIpB,KAJoB,CAKpB,IALoB,CAMpB,GANoB,CAOpB,GAPoB,CAQpB,GARoB,CASpB,IAToB,CAUpB,KAVoB,CAWpB,KAXoB,CAYpB,KAZoB,CAapB,KAboB,C,CAkBhBC,UAA8B,CAAG,CACrC,MAAO,GAD8B,CAErC,MAAO,GAF8B,CAGrC,MAAO,GAH8B,CAIrC,MAAO,GAJ8B,CAKrC,GAAM,GAL+B,CAMrC,EAAK,IANgC,CAOrC,EAAK,IAPgC,CAQrC,EAAK,IARgC,CASrC,GAAM,IAT+B,CAUrC,MAAO,IAV8B,CAWrC,MAAO,GAX8B,CAYrC,MAAO,IAZ8B,CAarC,MAAO,IAb8B,C,CAgBvC,MAAO,IAAMC,eAAc,CAAG,SAC5BC,CAD4B,CAEzB,IACGC,EAAS,CAAGD,CAAG,EAAKF,UADvB,GAGyBJ,QAAQ,CAAmB,iBACrDE,QAAO,CAACM,MAAM,CAACC,UAAR,CAAoBF,CAApB,CAD8C,CAAnB,CAHjC,uBAGIG,CAHJ,MAGYC,CAHZ,MAmBH,MAZAZ,gBAAe,CAAC,UAAM,CACpB,GAAMa,EAAS,CAAG,UAAM,CACtB,GAAMC,EAAS,CAAGX,OAAO,CAACM,MAAM,CAACC,UAAR,CAAoBF,CAApB,CAAzB,CAEAI,CAAS,CAAC,SAACG,CAAD,QAAYb,KAAI,CAACa,CAAD,CAAQD,CAAR,CAAJ,CAAyBC,CAAzB,CAAiCD,CAA7C,CAAD,CACV,CAJD,CAQA,MAFAL,OAAM,CAACO,gBAAP,CAAwB,QAAxB,CAAkCH,CAAlC,CAEA,CAAO,iBAAMJ,OAAM,CAACQ,mBAAP,CAA2B,QAA3B,CAAqCJ,CAArC,CAAN,CACR,CAVc,CAUZ,EAVY,CAYf,CAAOF,CACR,CAtBM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./useBreakpointsDepricated";
|
|
1
|
+
export*from"./useBreakpointsDepricated";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/hooks/useBreakpointsDepricated/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/hooks/useBreakpointsDepricated/index.ts"],"sourcesContent":["/* cspell:disable-next-line */\nexport * from './useBreakpointsDepricated';\n"],"mappings":"AACA"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const useBreakpoints: <POINTS extends string = "s" | "m" | "xs" | "l" | "2xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "3xs" | "5xs" | "4xs">(map?: Map<POINTS> | undefined) => Returned<POINTS>;
|
|
1
|
+
export * from '../useBreakpointsDeprecated';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export*from"../useBreakpointsDeprecated";
|
|
2
2
|
//# sourceMappingURL=useBreakpointsDepricated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBreakpointsDepricated.js","names":[
|
|
1
|
+
{"version":3,"file":"useBreakpointsDepricated.js","names":[],"sources":["../../../../../src/hooks/useBreakpointsDepricated/useBreakpointsDepricated.ts"],"sourcesContent":["export * from '../useBreakpointsDeprecated';\n"],"mappings":"AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChoiceGroup.js","names":["isNotNil","isMultiple","params","multiple","isNotMultiple","formatValue","valueProp","getKey","valueByKey","Array","isArray","value","length","item","useChoiceGroup","props","
|
|
1
|
+
{"version":3,"file":"useChoiceGroup.js","names":["isNotNil","isMultiple","params","multiple","isNotMultiple","formatValue","valueProp","getKey","valueByKey","Array","isArray","value","length","item","useChoiceGroup","props","formattedValue","getChecked","Object","prototype","hasOwnProperty","call","getOnChange","selectedItem","e","newValue","filter","push","callBack"],"sources":["../../../../../src/hooks/useChoiceGroup/useChoiceGroup.tsx"],"sourcesContent":["import { isNotNil } from '##/utils/type-guards';\n\ntype GetKey<ITEM> = (item: ITEM) => string | number;\n\ntype GetOnChange<ITEM, EVENT> = (item: ITEM) => (e: EVENT) => void;\n\ntype GetChecked<ITEM> = (item: ITEM) => boolean;\n\ntype UseChoiceGroupValues<ITEM, EVENT> = {\n getOnChange: GetOnChange<ITEM, EVENT>;\n getChecked: GetChecked<ITEM>;\n};\n\nexport type CallbackWithMultiple<ITEM, EVENT> = (\n value: ITEM[] | null,\n props: {\n e: EVENT;\n },\n) => void;\n\nexport type CallbackWithoutMultiple<ITEM, EVENT> = (\n value: ITEM,\n props: {\n e: EVENT;\n },\n) => void;\n\ntype PropsWithMultiple<ITEM, EVENT> = {\n multiple: true;\n value: ITEM[] | null;\n callBack?: CallbackWithMultiple<ITEM, EVENT>;\n};\n\ntype PropsWithoutMultiple<ITEM, EVENT> = {\n multiple: false;\n value: ITEM | null;\n callBack?: CallbackWithoutMultiple<ITEM, EVENT>;\n};\n\ntype CommonProps<ITEM> = {\n getKey: GetKey<ITEM>;\n};\n\ntype UseChoiceGroupProps<ITEM, EVENT> = CommonProps<ITEM> &\n (PropsWithMultiple<ITEM, EVENT> | PropsWithoutMultiple<ITEM, EVENT>);\n\ntype FormattedItems<ITEM> = { [value: string]: ITEM };\n\nfunction isMultiple<ITEM, EVENT>(\n params: UseChoiceGroupProps<ITEM, EVENT>,\n): params is CommonProps<ITEM> & PropsWithMultiple<ITEM, EVENT> {\n return params.multiple;\n}\n\nfunction isNotMultiple<ITEM, EVENT>(\n params: UseChoiceGroupProps<ITEM, EVENT>,\n): params is CommonProps<ITEM> & PropsWithoutMultiple<ITEM, EVENT> {\n return !params.multiple;\n}\n\nfunction formatValue<ITEM>(\n valueProp: ITEM | ITEM[] | null,\n getKey: GetKey<ITEM>,\n multiple?: boolean,\n) {\n const valueByKey: FormattedItems<ITEM> = {};\n if (!isNotNil(valueProp) && !Array.isArray(valueProp)) {\n return valueByKey;\n }\n const value = multiple ? (valueProp as ITEM[]) : [valueProp as ITEM];\n if (value && value.length > 0) {\n for (const item of value) {\n valueByKey[getKey(item)] = item;\n }\n }\n return valueByKey;\n}\n\nexport function useChoiceGroup<ITEM, EVENT>(\n props: UseChoiceGroupProps<ITEM, EVENT>,\n): UseChoiceGroupValues<ITEM, EVENT> {\n const formattedValue = formatValue(props.value, props.getKey, props.multiple);\n\n const getChecked: GetChecked<ITEM> = (item) =>\n Object.prototype.hasOwnProperty.call(formattedValue, props.getKey(item));\n\n const getOnChange: GetOnChange<ITEM, EVENT> = (selectedItem) => (e) => {\n if (isMultiple(props)) {\n let newValue: ITEM[] | null;\n\n if (getChecked(selectedItem)) {\n const value = props.value || [];\n newValue = value.filter(\n (item) => props.getKey(item) !== props.getKey(selectedItem),\n );\n if (newValue.length === 0) {\n newValue = null;\n }\n } else {\n newValue = props.value ? [...props.value] : [];\n newValue.push(selectedItem);\n }\n props.callBack?.(newValue, { e });\n }\n\n if (isNotMultiple(props)) {\n props.callBack?.(selectedItem, { e });\n }\n };\n\n return {\n getOnChange,\n getChecked,\n };\n}\n"],"mappings":"s7CAAA,OAASA,QAAT,+BAgDA,QAASC,WAAT,CACEC,CADF,CAEgE,CAC9D,MAAOA,EAAM,CAACC,QACf,CAED,QAASC,cAAT,CACEF,CADF,CAEmE,CACjE,MAAO,CAACA,CAAM,CAACC,QAChB,CAED,QAASE,YAAT,CACEC,CADF,CAEEC,CAFF,CAGEJ,CAHF,CAIE,CACA,GAAMK,EAAg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CAAK,CAACJ,KAAN,oBAAkBI,CAAK,CAACJ,KAAxB,EAAiC,EAT9C,CAUEc,CAAQ,CAACE,IAAT,CAAcJ,CAAd,CAVF,CAHqB,UAerBR,CAAK,CAACa,QAfe,qBAerB,OAAAb,CAAK,CAAYU,CAAZ,CAAsB,CAAED,CAAC,CAADA,CAAF,CAAtB,CACN,CAED,GAAIpB,aAAa,CAACW,CAAD,CAAjB,CAA0B,iBACxBA,CAAK,CAACa,QADkB,qBACxB,OAAAb,CAAK,CAAYQ,CAAZ,CAA0B,CAAEC,CAAC,CAADA,CAAF,CAA1B,CACN,CACF,CAtB6C,CAwBvC,CAELP,UAAU,CAAVA,CAFK,CAIR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useClickOutside.js","names":["useEffect","useMutableRef","useClickOutside","isActive","ignoreClicksInsideRefs","handler","handlerRef","ignoreClicksInsideRefsRef","isActiveRef","handleClick","event","current","target","shouldCallHandler","every","ref","contains","document","addEventListener","removeEventListener"],"sources":["../../../../../src/hooks/useClickOutside/useClickOutside.tsx"],"sourcesContent":["import { RefObject, useEffect } from 'react';\n\nimport { useMutableRef } from '../useMutableRef/useMutableRef';\n\nexport type ClickOutsideHandler = (event: MouseEvent) => void;\n\ntype UseClickOutsideProps = {\n isActive?: boolean;\n ignoreClicksInsideRefs?: ReadonlyArray<RefObject<HTMLElement>>;\n handler?: ClickOutsideHandler;\n};\n\nexport function useClickOutside({\n isActive,\n ignoreClicksInsideRefs,\n handler,\n}: UseClickOutsideProps): void {\n // Аргументы вынесены в рефки за тем, чтобы не пересоздавать подписку `mousedown` при
|
|
1
|
+
{"version":3,"file":"useClickOutside.js","names":["useEffect","useMutableRef","useClickOutside","isActive","ignoreClicksInsideRefs","handler","handlerRef","ignoreClicksInsideRefsRef","isActiveRef","handleClick","event","current","target","shouldCallHandler","every","ref","contains","document","addEventListener","removeEventListener"],"sources":["../../../../../src/hooks/useClickOutside/useClickOutside.tsx"],"sourcesContent":["import { RefObject, useEffect } from 'react';\n\nimport { useMutableRef } from '../useMutableRef/useMutableRef';\n\nexport type ClickOutsideHandler = (event: MouseEvent) => void;\n\ntype UseClickOutsideProps = {\n isActive?: boolean;\n ignoreClicksInsideRefs?: ReadonlyArray<RefObject<HTMLElement>>;\n handler?: ClickOutsideHandler;\n};\n\nexport function useClickOutside({\n isActive,\n ignoreClicksInsideRefs,\n handler,\n}: UseClickOutsideProps): void {\n // Аргументы вынесены в рефки за тем, чтобы не пересоздавать подписку `mousedown` при каждом чихе.\n // Бывают кейсы когда на странице несколько `useClickOutside` и один вызывает рендер,\n // А второй не успевает отрабатывать а просто пересоздается\n // С такой реализацией пересоздание только при удалении из дома, а аргументы всегда актуальны.\n\n const handlerRef = useMutableRef(handler);\n const ignoreClicksInsideRefsRef = useMutableRef(ignoreClicksInsideRefs);\n const isActiveRef = useMutableRef(isActive);\n\n useEffect(() => {\n const handleClick = (event: MouseEvent) => {\n if (!isActiveRef.current) {\n return;\n }\n\n const target = event.target as Node;\n\n const shouldCallHandler = ignoreClicksInsideRefsRef.current?.every(\n (ref) => !ref.current?.contains(target),\n );\n\n shouldCallHandler && handlerRef.current?.(event);\n };\n\n document.addEventListener('mousedown', handleClick);\n\n return () => {\n document.removeEventListener('mousedown', handleClick);\n };\n }, []);\n}\n"],"mappings":"AAAA,OAAoBA,SAApB,KAAqC,OAArC,CAEA,OAASC,aAAT,sCAUA,MAAO,SAASC,gBAAT,GAIwB,IAH7BC,EAG6B,GAH7BA,QAG6B,CAF7BC,CAE6B,GAF7BA,sBAE6B,CAD7BC,CAC6B,GAD7BA,OAC6B,CAMvBC,CAAU,CAAGL,aAAa,CAACI,CAAD,CANH,CAOvBE,CAAyB,CAAGN,aAAa,CAACG,CAAD,CAPlB,CAQvBI,CAAW,CAAGP,aAAa,CAACE,CAAD,CARJ,CAU7BH,SAAS,CAAC,UAAM,CACd,GAAMS,EAAW,CAAG,SAACC,CAAD,CAAuB,SACzC,GAAKF,CAAW,CAACG,OAAjB,KAIMC,EAAM,CAAGF,CAAK,CAACE,MAJrB,CAMMC,CAAiB,WAAGN,CAAyB,CAACI,OAA7B,qBAAG,EAAmCG,KAAnC,CACxB,SAACC,CAAD,cAAS,YAACA,CAAG,CAACJ,OAAL,eAAC,EAAaK,QAAb,CAAsBJ,CAAtB,CAAD,CAAT,CADwB,CAN1B,CAUAC,CAAiB,aAAIP,CAAU,CAACK,OAAf,qBAAI,OAAAL,CAAU,CAAWI,CAAX,CAAd,CAVjB,CAWD,CAZD,CAgBA,MAFAO,SAAQ,CAACC,gBAAT,CAA0B,WAA1B,CAAuCT,CAAvC,CAEA,CAAO,UAAM,CACXQ,QAAQ,CAACE,mBAAT,CAA6B,WAA7B,CAA0CV,CAA1C,CACD,CACF,CApBQ,CAoBN,EApBM,CAqBV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/hooks/useComponentBreakpointsDeprecated/index.ts"],"sourcesContent":["export * from './useComponentBreakpointsDeprecated';\nexport * from '##/hooks/useBreakpoints/getLastPoint';\n"],"mappings":"AAAA,iDACA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{useLayoutEffect,useState}from"react";import{mapping}from"../useBreakpoints/mapping";import{useMutableRef}from"../useMutableRef";import{isEq}from"../../utils/object/isEq";var getWidth=function(a){var b;return(null===(b=a.current)||void 0===b?void 0:b.getBoundingClientRect().width)||0};export var useComponentBreakpoints=function(a,b){var c=useState(function(){return mapping(getWidth(a),b)}),d=_slicedToArray(c,2),e=d[0],f=d[1],g=useMutableRef(b);return useLayoutEffect(function(){var b=new ResizeObserver(function(){var b=mapping(getWidth(a),g.current);f(function(a){return isEq(a,b)?a:b})});return a.current&&b.observe(a.current),function(){b.disconnect()}},[a.current]),e};
|
|
2
|
+
//# sourceMappingURL=useComponentBreakpointsDeprecated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useComponentBreakpointsDeprecated.js","names":["useLayoutEffect","useState","mapping","useMutableRef","isEq","getWidth","ref","current","getBoundingClientRect","width","useComponentBreakpoints","map","points","setSetPoints","mapRef","resizeObserver","ResizeObserver","newPoints","state","observe","disconnect"],"sources":["../../../../../src/hooks/useComponentBreakpointsDeprecated/useComponentBreakpointsDeprecated.ts"],"sourcesContent":["import { useLayoutEffect, useState } from 'react';\n\nimport { mapping } from '##/hooks/useBreakpoints/mapping';\nimport { Map, Returned } from '##/hooks/useBreakpoints/types';\nimport { useMutableRef } from '##/hooks/useMutableRef';\nimport { isEq } from '##/utils/object/isEq';\n\nconst getWidth = (ref: React.RefObject<HTMLElement | SVGGraphicsElement>) =>\n ref.current?.getBoundingClientRect().width || 0;\n\nexport const useComponentBreakpoints = <POINTS extends string>(\n ref: React.RefObject<HTMLElement | SVGGraphicsElement>,\n map: Map<POINTS>,\n) => {\n const [points, setSetPoints] = useState<Returned<POINTS>>(() =>\n mapping(getWidth(ref), map),\n );\n\n const mapRef = useMutableRef(map);\n\n useLayoutEffect(() => {\n const resizeObserver = new ResizeObserver(() => {\n const newPoints = mapping(getWidth(ref), mapRef.current);\n setSetPoints((state) => (isEq(state, newPoints) ? state : newPoints));\n });\n\n ref.current && resizeObserver.observe(ref.current);\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [ref.current]);\n\n return points;\n};\n"],"mappings":"iEAAA,OAASA,eAAT,CAA0BC,QAA1B,KAA0C,OAA1C,CAEA,OAASC,OAAT,iCAEA,OAASC,aAAT,wBACA,OAASC,IAAT,+BAEA,GAAMC,SAAQ,CAAG,SAACC,CAAD,cACf,WAAAA,CAAG,CAACC,OAAJ,uBAAaC,qBAAb,GAAqCC,KAArC,GAA8C,CAD/B,CAAjB,CAGA,MAAO,IAAMC,wBAAuB,CAAG,SACrCJ,CADqC,CAErCK,CAFqC,CAGlC,OAC4BV,QAAQ,CAAmB,iBACxDC,QAAO,CAACG,QAAQ,CAACC,CAAD,CAAT,CAAgBK,CAAhB,CADiD,CAAnB,CADpC,uBACIC,CADJ,MACYC,CADZ,MAKGC,CAAM,CAAGX,aAAa,CAACQ,CAAD,CALzB,CAoBH,MAbAX,gBAAe,CAAC,UAAM,CACpB,GAAMe,EAAc,CAAG,GAAIC,eAAJ,CAAmB,UAAM,CAC9C,GAAMC,EAAS,CAAGf,OAAO,CAACG,QAAQ,CAACC,CAAD,CAAT,CAAgBQ,CAAM,CAACP,OAAvB,CAAzB,CACAM,CAAY,CAAC,SAACK,CAAD,QAAYd,KAAI,CAACc,CAAD,CAAQD,CAAR,CAAJ,CAAyBC,CAAzB,CAAiCD,CAA7C,CAAD,CACb,CAHsB,CAAvB,CAOA,MAFAX,EAAG,CAACC,OAAJ,EAAeQ,CAAc,CAACI,OAAf,CAAuBb,CAAG,CAACC,OAA3B,CAEf,CAAO,UAAM,CACXQ,CAAc,CAACK,UAAf,EACD,CACF,CAXc,CAWZ,CAACd,CAAG,CAACC,OAAL,CAXY,CAaf,CAAOK,CACR,CAxBM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./useComponentBreakpointsDepricated";
|
|
1
|
+
export*from"./useComponentBreakpointsDepricated";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/hooks/useComponentBreakpointsDepricated/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/hooks/useComponentBreakpointsDepricated/index.ts"],"sourcesContent":["/* cspell:disable-next-line */\nexport * from './useComponentBreakpointsDepricated';\n"],"mappings":"AACA"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const useComponentBreakpoints: <POINTS extends string>(ref: React.RefObject<HTMLElement | SVGGraphicsElement>, map: Map<POINTS>) => Returned<POINTS>;
|
|
1
|
+
export * from '../useComponentBreakpointsDeprecated';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export*from"../useComponentBreakpointsDeprecated";
|
|
2
2
|
//# sourceMappingURL=useComponentBreakpointsDepricated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useComponentBreakpointsDepricated.js","names":[
|
|
1
|
+
{"version":3,"file":"useComponentBreakpointsDepricated.js","names":[],"sources":["../../../../../src/hooks/useComponentBreakpointsDepricated/useComponentBreakpointsDepricated.ts"],"sourcesContent":["export * from '../useComponentBreakpointsDeprecated';\n"],"mappings":"AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useHideElementsInLineDeprecated';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/hooks/useHideElementsInLineDeprecated/index.ts"],"sourcesContent":["export * from './useHideElementsInLineDeprecated';\n"],"mappings":"AAAA"}
|
package/__internal__/src/hooks/useHideElementsInLineDeprecated/useHideElementsInLineDeprecated.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const useHideElementsInLine: <ITEM, ELEMENT extends HTMLElement = HTMLDivElement, WRAPPER_ELEMENT extends HTMLElement = HTMLDivElement>(items: ITEM[], busy?: number, reverse?: boolean) => {
|
|
3
|
+
visibleItems: ITEM[];
|
|
4
|
+
hiddenItems: ITEM[];
|
|
5
|
+
itemsRefs: import("react").RefObject<ELEMENT>[];
|
|
6
|
+
wrapperRef: import("react").RefObject<WRAPPER_ELEMENT>;
|
|
7
|
+
moreRef: import("react").RefObject<ELEMENT> | undefined;
|
|
8
|
+
itemsDimensions: number[];
|
|
9
|
+
wrapperWidth: number;
|
|
10
|
+
};
|
package/__internal__/src/hooks/useHideElementsInLineDeprecated/useHideElementsInLineDeprecated.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import{useRef}from"react";import{useComponentSize}from"../useComponentSize/useComponentSize";import{useRefs}from"../useRefs/useRefs";import{useResizeObserved}from"../useResizeObserved/useResizeObserved";export var useHideElementsInLine=function(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,c=2<arguments.length?arguments[2]:void 0,d=useRefs(a.length+1,a),e=useRef(null),f=useComponentSize(e).width,g=_toConsumableArray(d),h=g.pop(),i=useResizeObserved(d,function(a){return a?parseInt(getComputedStyle(a).marginRight,10)+parseInt(getComputedStyle(a).marginLeft,10)+a.offsetWidth:0}),j=[],k=[];if(f){var l=(i[i.length-1]||0)+b;if(c)for(var m=i.length-2;0<=m;m--){if(l+=i[m],l>=f){a[m]&&k.push(a[m]);continue}j.push(a[m])}else for(var n=0;n<i.length;n++){if(l+=i[n],l>=f){a[n]&&k.push(a[n]);continue}j.push(a[n])}}return c&&(j.reverse(),k.reverse()),{visibleItems:j,hiddenItems:k,itemsRefs:g,wrapperRef:e,moreRef:h,itemsDimensions:i,wrapperWidth:f}};
|
|
2
|
+
//# sourceMappingURL=useHideElementsInLineDeprecated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHideElementsInLineDeprecated.js","names":["useRef","useComponentSize","useRefs","useResizeObserved","useHideElementsInLine","items","busy","reverse","refs","length","wrapperRef","wrapperWidth","width","itemsRefs","moreRef","pop","itemsDimensions","el","parseInt","getComputedStyle","marginRight","marginLeft","offsetWidth","visibleItems","hiddenItems","calcWidth","index","push"],"sources":["../../../../../src/hooks/useHideElementsInLineDeprecated/useHideElementsInLineDeprecated.ts"],"sourcesContent":["import { useRef } from 'react';\n\nimport { useComponentSize } from '../useComponentSize/useComponentSize';\nimport { useRefs } from '../useRefs/useRefs';\nimport { useResizeObserved } from '../useResizeObserved/useResizeObserved';\n\nexport const useHideElementsInLine = <\n ITEM,\n ELEMENT extends HTMLElement = HTMLDivElement,\n WRAPPER_ELEMENT extends HTMLElement = HTMLDivElement,\n>(\n items: ITEM[],\n busy = 0,\n reverse?: boolean,\n) => {\n const refs = useRefs<ELEMENT>(items.length + 1, items);\n const wrapperRef = useRef<WRAPPER_ELEMENT>(null);\n const wrapperWidth = useComponentSize(wrapperRef).width;\n const itemsRefs = [...refs];\n const moreRef = itemsRefs.pop();\n\n const itemsDimensions = useResizeObserved(refs, (el) =>\n el\n ? parseInt(getComputedStyle(el).marginRight, 10) +\n parseInt(getComputedStyle(el).marginLeft, 10) +\n el.offsetWidth\n : 0,\n );\n\n const visibleItems: ITEM[] = [];\n const hiddenItems: ITEM[] = [];\n\n if (wrapperWidth) {\n let calcWidth = (itemsDimensions[itemsDimensions.length - 1] || 0) + busy;\n\n if (reverse) {\n for (let index = itemsDimensions.length - 2; index >= 0; index--) {\n calcWidth += itemsDimensions[index];\n\n if (calcWidth >= wrapperWidth) {\n items[index] && hiddenItems.push(items[index]);\n\n continue;\n }\n visibleItems.push(items[index]);\n }\n } else {\n for (let index = 0; index < itemsDimensions.length; index++) {\n calcWidth += itemsDimensions[index];\n\n if (calcWidth >= wrapperWidth) {\n items[index] && hiddenItems.push(items[index]);\n\n continue;\n }\n visibleItems.push(items[index]);\n }\n }\n }\n\n if (reverse) {\n visibleItems.reverse();\n hiddenItems.reverse();\n }\n\n return {\n visibleItems,\n hiddenItems,\n itemsRefs,\n wrapperRef,\n moreRef,\n itemsDimensions,\n wrapperWidth,\n };\n};\n"],"mappings":"yEAAA,OAASA,MAAT,KAAuB,OAAvB,CAEA,OAASC,gBAAT,4CACA,OAASC,OAAT,0BACA,OAASC,iBAAT,8CAEA,MAAO,IAAMC,sBAAqB,CAAG,SAKnCC,CALmC,CAQhC,IAFHC,EAEG,wDAFI,CAEJ,CADHC,CACG,wCACGC,CAAI,CAAGN,OAAO,CAAUG,CAAK,CAACI,MAAN,CAAe,CAAzB,CAA4BJ,CAA5B,CADjB,CAEGK,CAAU,CAAGV,MAAM,CAAkB,IAAlB,CAFtB,CAGGW,CAAY,CAAGV,gBAAgB,CAACS,CAAD,CAAhB,CAA6BE,KAH/C,CA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Z,CAAiBtB,CAAK,CAACqB,CAAD,CAAtB,CADa,CAG7B,QACD,CACDH,CAAY,CAACI,IAAb,CAAkBtB,CAAK,CAACqB,CAAD,CAAvB,CACD,CAEJ,CAOD,MALInB,EAKJ,GAJEgB,CAAY,CAAChB,OAAb,EAIF,CAHEiB,CAAW,CAACjB,OAAZ,EAGF,EAAO,CACLgB,YAAY,CAAZA,CADK,CAELC,WAAW,CAAXA,CAFK,CAGLX,SAAS,CAATA,CAHK,CAILH,UAAU,CAAVA,CAJK,CAKLI,OAAO,CAAPA,CALK,CAMLE,eAAe,CAAfA,CANK,CAOLL,YAAY,CAAZA,CAPK,CASR,CApEM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/hooks/useHideElementsInLineDepricated/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/hooks/useHideElementsInLineDepricated/index.ts"],"sourcesContent":["/* cspell:disable-next-line */\nexport * from './useHideElementsInLineDepricated';\n"],"mappings":"AACA"}
|
package/__internal__/src/hooks/useHideElementsInLineDepricated/useHideElementsInLineDepricated.d.ts
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const useHideElementsInLine: <ITEM, ELEMENT extends HTMLElement = HTMLDivElement, WRAPPER_ELEMENT extends HTMLElement = HTMLDivElement>(items: ITEM[], busy?: number, reverse?: boolean) => {
|
|
3
|
-
visibleItems: ITEM[];
|
|
4
|
-
hiddenItems: ITEM[];
|
|
5
|
-
itemsRefs: import("react").RefObject<ELEMENT>[];
|
|
6
|
-
wrapperRef: import("react").RefObject<WRAPPER_ELEMENT>;
|
|
7
|
-
moreRef: import("react").RefObject<ELEMENT> | undefined;
|
|
8
|
-
itemsDimensions: number[];
|
|
9
|
-
wrapperWidth: number;
|
|
10
|
-
};
|
|
1
|
+
export * from '../useHideElementsInLineDeprecated';
|
package/__internal__/src/hooks/useHideElementsInLineDepricated/useHideElementsInLineDepricated.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export*from"../useHideElementsInLineDeprecated";
|
|
2
2
|
//# sourceMappingURL=useHideElementsInLineDepricated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHideElementsInLineDepricated.js","names":[
|
|
1
|
+
{"version":3,"file":"useHideElementsInLineDepricated.js","names":[],"sources":["../../../../../src/hooks/useHideElementsInLineDepricated/useHideElementsInLineDepricated.ts"],"sourcesContent":["export * from '../useHideElementsInLineDeprecated';\n"],"mappings":"AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useKeysDeprecated';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/hooks/useKeysDeprecated/index.ts"],"sourcesContent":["export * from './useKeysDeprecated';\n"],"mappings":"AAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type KeyHandler = (prop: Record<string, unknown>, e: React.KeyboardEvent) => void;
|
|
3
|
+
export declare type KeyProps = {
|
|
4
|
+
onKeyDown?: (e: React.KeyboardEvent) => void;
|
|
5
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
7
|
+
onClick?: (e: React.MouseEvent<HTMLInputElement>) => void;
|
|
8
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare type UserKeysProps = {
|
|
11
|
+
[key: string]: (prop: {
|
|
12
|
+
keyCode: number;
|
|
13
|
+
key: string;
|
|
14
|
+
shift: boolean;
|
|
15
|
+
meta: boolean;
|
|
16
|
+
}, e: React.KeyboardEvent<Element>) => void;
|
|
17
|
+
};
|
|
18
|
+
export declare const useKeys: (userKeys: UserKeysProps) => (rest?: KeyProps) => KeyProps;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}export var useKeys=function(a){return function(b){return _objectSpread(_objectSpread({},b),{},{onKeyDown:function onKeyDown(c){var d=c.keyCode,e=c.key,f=c.shiftKey,g=c.metaKey,h=a[e]||a[d];"function"==typeof h&&h({keyCode:d,key:e,shift:f,meta:g},c),"function"==typeof(null===b||void 0===b?void 0:b.onKeyDown)&&b.onKeyDown(c)}})}};
|
|
2
|
+
//# sourceMappingURL=useKeysDeprecated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeysDeprecated.js","names":["useKeys","userKeys","rest","onKeyDown","e","keyCode","key","shift","shiftKey","meta","metaKey","handler"],"sources":["../../../../../src/hooks/useKeysDeprecated/useKeysDeprecated.tsx"],"sourcesContent":["export type KeyHandler = (\n prop: Record<string, unknown>,\n e: React.KeyboardEvent,\n) => void;\n\nexport type KeyProps = {\n onKeyDown?: (e: React.KeyboardEvent) => void;\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;\n onClick?: (e: React.MouseEvent<HTMLInputElement>) => void;\n onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;\n};\n\nexport type UserKeysProps = {\n [key: string]: (\n prop: { keyCode: number; key: string; shift: boolean; meta: boolean },\n e: React.KeyboardEvent<Element>,\n ) => void;\n};\n\nexport const useKeys = (userKeys: UserKeysProps) => {\n return (rest?: KeyProps): KeyProps => {\n return {\n ...rest,\n onKeyDown: (e: React.KeyboardEvent): void => {\n const { keyCode, key, shiftKey: shift, metaKey: meta } = e;\n const handler = userKeys[key] || userKeys[keyCode];\n if (typeof handler === 'function') {\n handler(\n {\n keyCode,\n key,\n shift,\n meta,\n },\n e,\n );\n }\n if (typeof rest?.onKeyDown === 'function') {\n rest.onKeyDown(e);\n }\n },\n };\n };\n};\n"],"mappings":"qqBAoBA,MAAO,IAAMA,QAAO,CAAG,SAACC,CAAD,CAA6B,CAClD,MAAO,UAACC,CAAD,CAA+B,CACpC,sCACKA,CADL,MAEEC,SAAS,CAAE,mBAACC,CAAD,CAAkC,IACnCC,EADmC,CACcD,CADd,CACnCC,OADmC,CAC1BC,CAD0B,CACcF,CADd,CAC1BE,GAD0B,CACXC,CADW,CACcH,CADd,CACrBI,QADqB,CACKC,CADL,CACcL,CADd,CACJM,OADI,CAErCC,CAAO,CAAGV,CAAQ,CAACK,CAAD,CAAR,EAAiBL,CAAQ,CAACI,CAAD,CAFE,CAGpB,UAAnB,QAAOM,EAHgC,EAIzCA,CAAO,CACL,CACEN,OAAO,CAAPA,CADF,CAEEC,GAAG,CAAHA,CAFF,CAGEC,KAAK,CAALA,CAHF,CAIEE,IAAI,CAAJA,CAJF,CADK,CAOLL,CAPK,CAJkC,CAcZ,UAA3B,gBAAOF,CAAP,WAAOA,CAAP,QAAOA,CAAI,CAAEC,SAAb,CAduC,EAezCD,CAAI,CAACC,SAAL,CAAeC,CAAf,CAEH,CAnBH,EAqBD,CACF,CAxBM"}
|