@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
|
-
.TagBase{--tag-base-typo-color:var(--color-control-typo-ghost);--tag-base-half-space:calc(var(--tag-base-
|
|
1
|
+
.TagBase{--tag-base-typo-color:var(--color-control-typo-ghost);--tag-base-half-space:calc(var(--tag-base-space)/2);background:var(--tag-base-bg-color);border:none;border-radius:var(--control-radius);box-shadow:inset 0 0 0 1px var(--tag-base-border-color);color:var(--tag-base-typo-color);display:inline-flex;font-family:var(--font--primary);font-size:var(--tag-base-font-size);height:var(--tag-base-height);line-height:var(--tag-base-height);overflow:hidden;padding-bottom:0;padding-left:var(--tag-base-space);padding-right:var(--tag-base-space);padding-top:0;position:relative;text-decoration:none;transition:box-shadow .15s ease,background .15s ease,color .15s ease}.TagBase:focus,.TagBase:focus:hover{outline:none}.TagBase_view_stroked{--tag-base-border-color:var(--color-control-bg-border-default);--tag-base-bg-color:var(--color-bg-default)}.TagBase_view_filled{--tag-base-border-color:transparent;--tag-base-bg-color:var(--color-control-bg-ghost)}.TagBase_withAction{cursor:pointer}.TagBase_withAction.TagBase_view_stroked:hover{--tag-base-border-color:var(--color-control-bg-border-default-hover)}.TagBase_withAction.TagBase_view_filled:hover{--tag-base-bg-color:var(--color-control-bg-ghost-hover);--tag-base-border-color:transparent}.TagBase_size_xs{--tag-base-height:var(--space-l);--tag-base-space:var(--space-2xs);--tag-base-font-size:var(--size-text-2xs)}.TagBase_size_s{--tag-base-height:var(--space-xl);--tag-base-space:var(--space-xs);--tag-base-font-size:var(--size-text-xs)}.TagBase_size_m{--tag-base-height:calc(var(--space-2xl) - var(--space-2xs));--tag-base-space:var(--space-xs);--tag-base-font-size:var(--size-text-s)}.TagBase_size_l{--tag-base-height:var(--space-2xl);--tag-base-space:var(--space-s);--tag-base-font-size:var(--size-text-m)}.TagBase_withCancel{padding-right:0}.TagBase_withIcon{padding-left:0}.TagBase[class*=TagBase_group]:before{background:var(--tag-base-group-color);content:"";height:100%;left:0;position:absolute;top:0;width:2px}.TagBase_group_1{--tag-base-group-color:#e92064}.TagBase_group_2{--tag-base-group-color:#b92eff}.TagBase_group_3{--tag-base-group-color:#1160ff}.TagBase_group_4{--tag-base-group-color:#0fafff}.TagBase_group_5{--tag-base-group-color:#02e2ff}.TagBase_group_6{--tag-base-group-color:#0c6}.TagBase_group_7{--tag-base-group-color:#b4d50b}.TagBase_group_8{--tag-base-group-color:#f5b800}.TagBase_group_9{--tag-base-group-color:#f56600}.TagBase-CancelButton{align-items:center;background:transparent;border:none;color:var(--color-control-typo-ghost);cursor:pointer;display:inline-flex;height:var(--tag-base-height);opacity:.4;outline:none;padding:0 var(--tag-base-half-space) 0 var(--tag-base-half-space);transition:opacity .15s ease}.TagBase-CancelButton:hover{background:transparent;opacity:1;outline:none}.TagBase-Label{height:var(--tag-base-height);line-height:var(--tag-base-height)}.TagBase-IconWrapper{align-items:center;display:inline-flex;height:var(--tag-base-height);padding:0 var(--tag-base-half-space) 0 var(--tag-base-half-space)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","type","value","defaultValue","onChange","id","name","rows","cols","minRows","maxRows","inputRef","maxLength","disabled","size","view","form","state","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","withClearButton","incrementButtons","max","min","readOnly","required","step","tabIndex","ariaLabel","label","labelIcon","inputContainerRef","labelPosition","caption","iconSize","focused","onClick","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onClear"];import"./TextField.css";import{IconClear}from"@consta/icons/IconClear";import{IconEye}from"@consta/icons/IconEye";import{IconEyeClose}from"@consta/icons/IconEyeClose";import{IconSelect}from"@consta/icons/IconSelect";import React,{forwardRef,useCallback,useEffect}from"react";import TextAreaAutoSize from"react-textarea-autosize";import{usePropsHandler}from"../EventInterceptor/usePropsHandler";import{FieldCaption}from"../FieldCaption/FieldCaption";import{FieldLabel}from"../FieldLabel/FieldLabel";import{useFlag}from"../../hooks/useFlag/useFlag";import{useForkRef}from"../../hooks/useForkRef/useForkRef";import{useKeys}from"../../hooks/useKeys";import{useMutableRef}from"../../hooks/useMutableRef/useMutableRef";import{useSortSteps}from"../../hooks/useSortSteps/useSortSteps";import{cn}from"../../utils/bem";import{getByMap}from"../../utils/getByMap";import{isString}from"../../utils/type-guards";import{getTypeForRender,getValueByStep,inputValue,sizeMap,stepIsActive}from"./helpers";import{textFieldPropFormDefault,textFieldPropSizeDefault,textFieldPropViewDefault}from"./types";export var COMPONENT_NAME="TextField";export var cnTextField=cn("TextField");export var TextFieldRender=function(a,b){var c,d,e=React.useRef(null),f=React.useRef(null),g=usePropsHandler(COMPONENT_NAME,a,e),h=g.className,i=g.type,j=void 0===i?"text":i,k=g.value,l=g.defaultValue,m=g.onChange,n=g.id,o=g.name,p=g.rows,q=g.cols,r=g.minRows,s=g.maxRows,t=g.inputRef,u=g.maxLength,v=g.disabled,w=g.size,x=void 0===w?textFieldPropSizeDefault:w,y=g.view,z=void 0===y?textFieldPropViewDefault:y,A=g.form,B=void 0===A?textFieldPropFormDefault:A,C=g.state,D=g.status,E=g.onBlur,F=g.onFocus,G=g.autoFocus,H=void 0!==G&&G,I=g.placeholder,J=g.leftSide,K=g.rightSide,L=g.autoComplete,M=g.withClearButton,N=g.incrementButtons,O=g.max,P=g.min,Q=g.readOnly,R=g.required,S=g.step,T=void 0===S?1:S,U=g.tabIndex,V=g.ariaLabel,W=g.label,X=g.labelIcon,Y=g.inputContainerRef,Z=g.labelPosition,$=void 0===Z?"top":Z,_=g.caption,aa=g.iconSize,ba=g.focused,ca=g.onClick,da=g.onKeyDown,ea=g.onKeyDownCapture,fa=g.onKeyPress,ga=g.onKeyPressCapture,ha=g.onKeyUp,ia=g.onKeyUpCapture,ja=g.onClear,ka=_objectWithoutProperties(g,_excluded),
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","type","value","defaultValue","onChange","id","name","rows","cols","minRows","maxRows","inputRef","maxLength","disabled","size","view","form","state","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","withClearButton","incrementButtons","max","min","readOnly","required","step","tabIndex","ariaLabel","label","labelIcon","inputContainerRef","labelPosition","caption","iconSize","focused","onClick","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onClear","onWheel"];import"./TextField.css";import{IconClear}from"@consta/icons/IconClear";import{IconEye}from"@consta/icons/IconEye";import{IconEyeClose}from"@consta/icons/IconEyeClose";import{IconSelect}from"@consta/icons/IconSelect";import React,{forwardRef,useCallback,useEffect}from"react";import TextAreaAutoSize from"react-textarea-autosize";import{usePropsHandler}from"../EventInterceptor/usePropsHandler";import{FieldCaption}from"../FieldCaption/FieldCaption";import{FieldLabel}from"../FieldLabel/FieldLabel";import{useFlag}from"../../hooks/useFlag/useFlag";import{useForkRef}from"../../hooks/useForkRef/useForkRef";import{useKeys}from"../../hooks/useKeys";import{useMutableRef}from"../../hooks/useMutableRef/useMutableRef";import{useSortSteps}from"../../hooks/useSortSteps/useSortSteps";import{cn}from"../../utils/bem";import{getByMap}from"../../utils/getByMap";import{isString}from"../../utils/type-guards";import{getTypeForRender,getValueByStep,inputValue,sizeMap,stepIsActive}from"./helpers";import{textFieldPropFormDefault,textFieldPropSizeDefault,textFieldPropViewDefault}from"./types";export var COMPONENT_NAME="TextField";export var cnTextField=cn("TextField");export var TextFieldRender=function(a,b){var c,d,e=React.useRef(null),f=React.useRef(null),g=usePropsHandler(COMPONENT_NAME,a,e),h=g.className,i=g.type,j=void 0===i?"text":i,k=g.value,l=g.defaultValue,m=g.onChange,n=g.id,o=g.name,p=g.rows,q=g.cols,r=g.minRows,s=g.maxRows,t=g.inputRef,u=g.maxLength,v=g.disabled,w=g.size,x=void 0===w?textFieldPropSizeDefault:w,y=g.view,z=void 0===y?textFieldPropViewDefault:y,A=g.form,B=void 0===A?textFieldPropFormDefault:A,C=g.state,D=g.status,E=g.onBlur,F=g.onFocus,G=g.autoFocus,H=void 0!==G&&G,I=g.placeholder,J=g.leftSide,K=g.rightSide,L=g.autoComplete,M=g.withClearButton,N=g.incrementButtons,O=g.max,P=g.min,Q=g.readOnly,R=g.required,S=g.step,T=void 0===S?1:S,U=g.tabIndex,V=g.ariaLabel,W=g.label,X=g.labelIcon,Y=g.inputContainerRef,Z=g.labelPosition,$=void 0===Z?"top":Z,_=g.caption,aa=g.iconSize,ba=g.focused,ca=g.onClick,da=g.onKeyDown,ea=g.onKeyDownCapture,fa=g.onKeyPress,ga=g.onKeyPressCapture,ha=g.onKeyUp,ia=g.onKeyUpCapture,ja=g.onClear,ka=g.onWheel,la=_objectWithoutProperties(g,_excluded),ma="number"===j&&(void 0===N||N),na=useFlag(H),oa=_slicedToArray(na,2),pa=oa[0],qa=oa[1],ra=useFlag(),sa=_slicedToArray(ra,2),ta=sa[0],ua=sa[1],va=useFlag(),wa=_slicedToArray(va,2),xa=wa[0],ya=wa[1],za=useMutableRef(ca),Aa=useMutableRef(m),Ba=useCallback(function(a){var b;a.stopPropagation(),ua.toggle(),null===(b=f.current)||void 0===b?void 0:b.focus()},[]),Ca=J,Da=K,Ea=isString(J),Fa=isString(K),Ga=getByMap(sizeMap,x,aa),Ha=useSortSteps({step:T,min:+P,max:+O}),Ia=useCallback(function(a){var b;v||(null===(b=Aa.current)||void 0===b?void 0:b.call(Aa,a.target.value||null,{e:a,id:n,name:o})),a.target.value?ya.on():ya.off()},[n,o,v]),Ja=function(a){qa.on(),null===F||void 0===F?void 0:F(a)},Ka={className:cnTextField("Input"),value:inputValue(k),defaultValue:inputValue(l),onChange:Ia,maxLength:u,disabled:v,onBlur:function handleBlur(a){qa.off(),null===E||void 0===E?void 0:E(a)},onFocus:Ja,autoFocus:H,placeholder:I,autoComplete:L,readOnly:Q,tabIndex:U,name:o,onKeyDownCapture:ea,onKeyPress:fa,onKeyPressCapture:ga,onKeyUp:ha,onKeyUpCapture:ia,id:n?n.toString():void 0,"aria-label":V},La=ta?IconEyeClose:IconEye,Ma=useKeys({isActive:!0,keys:{ArrowUp:function ArrowUp(a){if(a.preventDefault(),stepIsActive(T,j,v)){var b,c,d=getValueByStep(Ha,null===(b=f.current)||void 0===b?void 0:b.value,!0,P,O);null===(c=Aa.current)||void 0===c?void 0:c.call(Aa,d,{e:a,id:n,name:o}),f.current&&(f.current.value=d,ya.on())}},ArrowDown:function ArrowDown(a){if(a.preventDefault(),stepIsActive(T,j,v)){var b,c,d=getValueByStep(Ha,null===(b=f.current)||void 0===b?void 0:b.value,!1,P,O);null===(c=Aa.current)||void 0===c?void 0:c.call(Aa,d,{e:a,id:n,name:o}),f.current&&(f.current.value=d,ya.on())}}},onEvent:da}),Na={rows:p,cols:q,minRows:r||p,maxRows:s||p,ref:useForkRef([f,t])},Oa={type:getTypeForRender(j,ta),max:O,min:P,step:Array.isArray(Ha)?0:Ha,onKeyDown:Ma,onWheel:function onWheel(a){if(ka)ka(a);else if("number"===j){var b;null===(b=f.current)||void 0===b?void 0:b.blur()}},ref:useForkRef([f,t])},Pa=useCallback(function(a){var b;null===(b=Aa.current)||void 0===b?void 0:b.call(Aa,null,{e:a,id:n,name:o}),f.current&&(f.current.value="",ya.off())},[]),Qa=function(a){var b,c,d=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],e=getValueByStep(Ha,null===(b=f.current)||void 0===b?void 0:b.value,d,P,O);null===(c=Aa.current)||void 0===c?void 0:c.call(Aa,e,{e:a,id:n,name:o}),f.current&&(f.current.value=e,ya.on())},Ra={onClick:useCallback(function(a){var b,c;null===(b=f.current)||void 0===b?void 0:b.focus(),null===(c=za.current)||void 0===c?void 0:c.call(za,a)},[])};return useEffect(function(){var a;ya[null!==(a=f.current)&&void 0!==a&&a.value?"on":"off"]()},[null===(c=f.current)||void 0===c?void 0:c.value]),React.createElement("div",Object.assign({className:cnTextField({labelPosition:$,size:x,view:z},[h]),ref:useForkRef([b,e])},Ra,la),W&&React.createElement(FieldLabel,{as:"label",htmlFor:null===n||void 0===n?void 0:n.toString(),icon:X,required:R,className:cnTextField("Label",{labelPosition:$}),size:x},W),React.createElement("div",{className:cnTextField("Body")},React.createElement("div",{ref:Y,className:cnTextField("InputContainer",{view:z,form:B,status:D||C,disabled:v,type:j,focus:pa||ba,withValue:xa,incrementButtons:"number"===j&&ma})},Ca&&React.createElement("div",{className:cnTextField("Side",{position:"left",type:Ea?"string":"icon"}),title:"string"==typeof J?J:void 0},Ea?J:React.createElement(Ca,{className:cnTextField("Icon"),size:Ga})),"textarea"===j?React.createElement(TextAreaAutoSize,Object.assign({},Ka,Na)):React.createElement("input",Object.assign({},Ka,Oa)),ma&&stepIsActive(T,j,v)&&React.createElement("div",{className:cnTextField("Counter")},React.createElement("button",{className:cnTextField("CounterButton",{fn:"increment"}),onFocus:Ja,onClick:function(a){return Qa(a,!0)},type:"button"},React.createElement(IconSelect,{size:"xs"})),React.createElement("button",{className:cnTextField("CounterButton"),onFocus:Ja,onClick:function(a){return Qa(a,!1)},type:"button"},React.createElement(IconSelect,{size:"xs"}))),!ma&&xa&&M&&!v&&React.createElement("button",{type:"button",disabled:v,tabIndex:-1,onClick:ja||Pa,className:cnTextField("ClearButton")},React.createElement(IconClear,{size:sizeMap[x],className:cnTextField("ClearButtonIcon")})),"password"===j&&(null===(d=f.current)||void 0===d?void 0:d.value)&&React.createElement("button",{className:cnTextField("ClearButton"),type:"button",onClick:Ba},React.createElement(La,{className:cnTextField("Icon"),size:Ga})),Da&&!ma&&"password"!==j&&React.createElement("div",{className:cnTextField("Side",{position:"right",type:Fa?"string":"icon"}),title:"string"==typeof K?K:void 0},Fa?K:React.createElement(Da,{className:cnTextField("Icon"),size:Ga}))),_&&React.createElement(FieldCaption,{className:cnTextField("Caption"),status:D||C},_)))};export var TextField=forwardRef(TextFieldRender);export*from"./types";
|
|
2
2
|
//# sourceMappingURL=TextField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","names":["IconClear","IconEye","IconEyeClose","IconSelect","React","forwardRef","useCallback","useEffect","TextAreaAutoSize","usePropsHandler","FieldCaption","FieldLabel","useFlag","useForkRef","useKeys","useMutableRef","useSortSteps","cn","getByMap","isString","getTypeForRender","getValueByStep","inputValue","sizeMap","stepIsActive","textFieldPropFormDefault","textFieldPropSizeDefault","textFieldPropViewDefault","COMPONENT_NAME","cnTextField","TextFieldRender","props","ref","textFieldRef","useRef","inputRef","className","type","value","defaultValue","onChange","id","name","rows","cols","minRows","maxRows","inputRefProp","maxLength","disabled","size","view","form","state","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","withClearButton","incrementButtons","max","min","readOnly","required","step","tabIndex","ariaLabel","label","labelIcon","inputContainerRef","labelPosition","caption","iconSizeProp","iconSize","focused","onClick","onKeyDownProp","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onClear","otherProps","focus","setFocus","passwordVisible","setPasswordVisuble","withValue","setWithValue","onClickRef","onChangeRef","handleEyeClick","e","stopPropagation","toggle","current","LeftIcon","RightIcon","leftSideIsString","rightSideIsString","sortedSteps","handleChange","target","on","off","handleFocus","commonProps","handleBlur","toString","Eye","isActive","keys","ArrowUp","preventDefault","newValue","ArrowDown","onEvent","textareaProps","inputProps","Array","isArray","handleClear","changeNumberValue","isIncrement","rootProps","position","fn","TextField"],"sources":["../../../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import './TextField.css';\n\nimport { IconClear } from '@consta/icons/IconClear';\nimport { IconEye } from '@consta/icons/IconEye';\nimport { IconEyeClose } from '@consta/icons/IconEyeClose';\nimport { IconSelect } from '@consta/icons/IconSelect';\nimport React, { forwardRef, useCallback, useEffect } from 'react';\nimport TextAreaAutoSize from 'react-textarea-autosize';\n\nimport { usePropsHandler } from '##/components/EventInterceptor/usePropsHandler';\nimport { FieldCaption } from '##/components/FieldCaption/FieldCaption';\nimport { FieldLabel } from '##/components/FieldLabel/FieldLabel';\nimport { useFlag } from '##/hooks/useFlag/useFlag';\nimport { useForkRef } from '##/hooks/useForkRef/useForkRef';\nimport { useKeys } from '##/hooks/useKeys';\nimport { useMutableRef } from '##/hooks/useMutableRef/useMutableRef';\nimport { useSortSteps } from '##/hooks/useSortSteps/useSortSteps';\nimport { cn } from '##/utils/bem';\nimport { getByMap } from '##/utils/getByMap';\nimport { isString } from '##/utils/type-guards';\n\nimport {\n getTypeForRender,\n getValueByStep,\n inputValue,\n sizeMap,\n stepIsActive,\n} from './helpers';\nimport {\n TextFieldComponent,\n textFieldPropFormDefault,\n TextFieldProps,\n textFieldPropSizeDefault,\n textFieldPropViewDefault,\n} from './types';\n\nexport const COMPONENT_NAME = 'TextField' as const;\nexport const cnTextField = cn(COMPONENT_NAME);\n\nexport const TextFieldRender = <TYPE extends string>(\n props: TextFieldProps<TYPE>,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const textFieldRef = React.useRef<HTMLDivElement>(null);\n const inputRef = React.useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n\n const {\n className,\n type = 'text',\n value,\n defaultValue,\n onChange,\n id,\n name,\n rows,\n cols,\n minRows,\n maxRows,\n inputRef: inputRefProp,\n maxLength,\n disabled,\n size = textFieldPropSizeDefault,\n view = textFieldPropViewDefault,\n form = textFieldPropFormDefault,\n state,\n status,\n onBlur,\n onFocus,\n autoFocus = false,\n placeholder,\n leftSide,\n rightSide,\n autoComplete,\n withClearButton,\n incrementButtons: incrementButtonsProp = true,\n max,\n min,\n readOnly,\n required,\n step = 1,\n tabIndex,\n ariaLabel,\n label,\n labelIcon,\n inputContainerRef,\n labelPosition = 'top',\n caption,\n iconSize: iconSizeProp,\n focused,\n onClick,\n // onkey props\n onKeyDown: onKeyDownProp,\n onKeyDownCapture,\n onKeyPress,\n onKeyPressCapture,\n onKeyUp,\n onKeyUpCapture,\n onClear,\n ...otherProps\n } = usePropsHandler(COMPONENT_NAME, props, textFieldRef);\n\n const incrementButtons = type === 'number' ? incrementButtonsProp : false;\n\n const [focus, setFocus] = useFlag(autoFocus);\n const [passwordVisible, setPasswordVisuble] = useFlag();\n const [withValue, setWithValue] = useFlag();\n\n const onClickRef = useMutableRef(onClick);\n const onChangeRef = useMutableRef(onChange);\n\n const handleEyeClick = useCallback(\n (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n e.stopPropagation();\n setPasswordVisuble.toggle();\n inputRef.current?.focus();\n },\n [],\n );\n\n const textarea = type === 'textarea';\n const LeftIcon = leftSide;\n const RightIcon = rightSide;\n const leftSideIsString = isString(leftSide);\n const rightSideIsString = isString(rightSide);\n const iconSize = getByMap(sizeMap, size, iconSizeProp);\n\n const sortedSteps = useSortSteps({\n step,\n min: Number(min),\n max: Number(max),\n });\n\n const handleChange: React.ChangeEventHandler<\n HTMLInputElement | HTMLTextAreaElement\n > = useCallback(\n (e) => {\n !disabled &&\n onChangeRef.current?.(e.target.value || null, {\n e,\n id,\n name,\n });\n\n if (e.target.value) {\n setWithValue.on();\n } else {\n setWithValue.off();\n }\n },\n [id, name, disabled],\n );\n\n const handleBlur: React.FocusEventHandler<HTMLElement> = (e) => {\n setFocus.off();\n onBlur?.(e);\n };\n\n const handleFocus: React.FocusEventHandler<HTMLElement> = (e) => {\n setFocus.on();\n onFocus?.(e);\n };\n\n const commonProps = {\n 'className': cnTextField('Input'),\n 'value': inputValue(value),\n 'defaultValue': inputValue(defaultValue),\n 'onChange': handleChange,\n maxLength,\n disabled,\n 'onBlur': handleBlur,\n 'onFocus': handleFocus,\n autoFocus,\n placeholder,\n autoComplete,\n readOnly,\n tabIndex,\n name,\n onKeyDownCapture,\n onKeyPress,\n onKeyPressCapture,\n onKeyUp,\n onKeyUpCapture,\n 'id': id ? id.toString() : undefined,\n 'aria-label': ariaLabel,\n };\n\n const Eye = passwordVisible ? IconEyeClose : IconEye;\n\n const onKeyDown = useKeys({\n isActive: true,\n keys: {\n ArrowUp: (e) => {\n e.preventDefault();\n if (stepIsActive(step, type, disabled)) {\n const newValue = getValueByStep(\n sortedSteps,\n inputRef.current?.value,\n true,\n min,\n max,\n );\n\n onChangeRef.current?.(newValue, {\n e,\n id,\n name,\n });\n\n if (inputRef.current) {\n inputRef.current.value = newValue;\n setWithValue.on();\n }\n }\n },\n ArrowDown: (e) => {\n e.preventDefault();\n if (stepIsActive(step, type, disabled)) {\n const newValue = getValueByStep(\n sortedSteps,\n inputRef.current?.value,\n false,\n min,\n max,\n );\n\n onChangeRef.current?.(newValue, {\n e,\n id,\n name,\n });\n\n if (inputRef.current) {\n inputRef.current.value = newValue;\n setWithValue.on();\n }\n }\n },\n },\n onEvent: onKeyDownProp,\n });\n\n const textareaProps = {\n rows,\n cols,\n minRows: minRows || rows,\n maxRows: maxRows || rows,\n ref: useForkRef([inputRef, inputRefProp]) as (\n node: HTMLTextAreaElement,\n ) => void,\n };\n\n const inputProps = {\n type: getTypeForRender(type, passwordVisible),\n max,\n min,\n step: !Array.isArray(sortedSteps) ? sortedSteps : 0,\n onKeyDown,\n ref: useForkRef([\n inputRef,\n inputRefProp,\n ]) as React.RefCallback<HTMLInputElement>,\n };\n\n const handleClear = useCallback((e: React.MouseEvent<HTMLButtonElement>) => {\n onChangeRef.current?.(null, {\n e,\n id,\n name,\n });\n\n if (inputRef.current) {\n inputRef.current.value = '';\n setWithValue.off();\n }\n }, []);\n\n const changeNumberValue = (\n e: React.MouseEvent<HTMLButtonElement>,\n isIncrement = true,\n ) => {\n const newValue = getValueByStep(\n sortedSteps,\n inputRef.current?.value,\n isIncrement,\n min,\n max,\n );\n onChangeRef.current?.(newValue, {\n e,\n id,\n name,\n });\n if (inputRef.current) {\n inputRef.current.value = newValue;\n setWithValue.on();\n }\n };\n\n const rootProps = {\n onClick: useCallback((e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n inputRef.current?.focus();\n onClickRef.current?.(e);\n }, []),\n };\n\n useEffect(() => {\n setWithValue[inputRef.current?.value ? 'on' : 'off']();\n }, [inputRef.current?.value]);\n\n return (\n <div\n className={cnTextField({ labelPosition, size, view }, [className])}\n ref={useForkRef([ref, textFieldRef])}\n {...rootProps}\n {...otherProps}\n >\n {label && (\n <FieldLabel\n as=\"label\"\n htmlFor={id?.toString()}\n icon={labelIcon}\n required={required}\n className={cnTextField('Label', { labelPosition })}\n size={size}\n >\n {label}\n </FieldLabel>\n )}\n <div className={cnTextField('Body')}>\n <div\n ref={inputContainerRef}\n className={cnTextField('InputContainer', {\n view,\n form,\n status: status || state,\n disabled,\n type,\n focus: focus || focused,\n withValue,\n incrementButtons: type === 'number' && incrementButtons,\n })}\n >\n {LeftIcon && (\n <div\n className={cnTextField('Side', {\n position: 'left',\n type: leftSideIsString ? 'string' : 'icon',\n })}\n title={typeof leftSide === 'string' ? leftSide : undefined}\n >\n {leftSideIsString ? (\n leftSide\n ) : (\n <LeftIcon className={cnTextField('Icon')} size={iconSize} />\n )}\n </div>\n )}\n {textarea ? (\n <TextAreaAutoSize {...commonProps} {...textareaProps} />\n ) : (\n <input {...commonProps} {...inputProps} />\n )}\n\n {incrementButtons && stepIsActive(step, type, disabled) && (\n <div className={cnTextField('Counter')}>\n <button\n className={cnTextField('CounterButton', { fn: 'increment' })}\n onFocus={handleFocus}\n onClick={(e) => changeNumberValue(e, true)}\n type=\"button\"\n >\n <IconSelect size=\"xs\" />\n </button>\n <button\n className={cnTextField('CounterButton')}\n onFocus={handleFocus}\n onClick={(e) => changeNumberValue(e, false)}\n type=\"button\"\n >\n <IconSelect size=\"xs\" />\n </button>\n </div>\n )}\n\n {!incrementButtons && withValue && withClearButton && !disabled && (\n <button\n type=\"button\"\n disabled={disabled}\n tabIndex={-1}\n onClick={onClear || handleClear}\n className={cnTextField('ClearButton')}\n >\n <IconClear\n size={sizeMap[size]}\n className={cnTextField('ClearButtonIcon')}\n />\n </button>\n )}\n\n {type === 'password' && inputRef.current?.value && (\n <button\n className={cnTextField('ClearButton')}\n type=\"button\"\n onClick={handleEyeClick}\n >\n <Eye className={cnTextField('Icon')} size={iconSize} />\n </button>\n )}\n\n {RightIcon && !incrementButtons && type !== 'password' && (\n <div\n className={cnTextField('Side', {\n position: 'right',\n type: rightSideIsString ? 'string' : 'icon',\n })}\n title={typeof rightSide === 'string' ? rightSide : undefined}\n >\n {rightSideIsString ? (\n rightSide\n ) : (\n <RightIcon className={cnTextField('Icon')} size={iconSize} />\n )}\n </div>\n )}\n </div>\n {caption && (\n <FieldCaption\n className={cnTextField('Caption')}\n status={status || state}\n >\n {caption}\n </FieldCaption>\n )}\n </div>\n </div>\n );\n};\n\nexport const TextField = forwardRef(TextFieldRender) as TextFieldComponent;\nexport * from './types';\n"],"mappings":"+sBAAA,wBAEA,OAASA,SAAT,KAA0B,yBAA1B,CACA,OAASC,OAAT,KAAwB,uBAAxB,CACA,OAASC,YAAT,KAA6B,4BAA7B,CACA,OAASC,UAAT,KAA2B,0BAA3B,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,WAA5B,CAAyCC,SAAzC,KAA0D,OAA1D,CACA,MAAOC,iBAAP,KAA6B,yBAA7B,CAEA,OAASC,eAAT,2CACA,OAASC,YAAT,oCACA,OAASC,UAAT,gCACA,OAASC,OAAT,mCACA,OAASC,UAAT,yCACA,OAASC,OAAT,2BACA,OAASC,aAAT,+CACA,OAASC,YAAT,6CACA,OAASC,EAAT,uBACA,OAASC,QAAT,4BACA,OAASC,QAAT,+BAEA,OACEC,gBADF,CAEEC,cAFF,CAGEC,UAHF,CAIEC,OAJF,CAKEC,YALF,iBAOA,OAEEC,wBAFF,CAIEC,wBAJF,CAKEC,wBALF,eAQA,MAAO,IAAMC,eAAc,CAAG,WAAvB,CACP,MAAO,IAAMC,YAAW,CAAGZ,EAAE,aAAtB,CAEP,MAAO,IAAMa,gBAAe,CAAG,SAC7BC,CAD6B,CAE7BC,CAF6B,CAG1B,SACGC,CAAY,CAAG7B,KAAK,CAAC8B,MAAN,CAA6B,IAA7B,CADlB,CAEGC,CAAQ,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D,CADf,CAEE,SAAS,CAAErB,WAAW,CAAC,iBAAD,CAFxB,EAPF,CAxDJ,CAsEY,UAAT,GAAAQ,CAAI,aAAmBF,CAAQ,CAACkE,OAA5B,qBAAmB,EAAkB/D,KAArC,CAAJ,EACC,8BACE,SAAS,CAAET,WAAW,CAAC,aAAD,CADxB,CAEE,IAAI,CAAC,QAFP,CAGE,OAAO,CAAEoE,EAHX,EAKE,oBAAC,EAAD,EAAK,SAAS,CAAEpE,WAAW,CAAC,MAAD,CAA3B,CAAqC,IAAI,CAAEgD,EAA3C,EALF,CAvEJ,CAgFG0B,EAAS,EAAI,CAACxC,EAAd,EAA2C,UAAT,GAAA1B,CAAlC,EACC,2BACE,SAAS,CAAER,WAAW,CAAC,MAAD,CAAS,CAC7BsG,QAAQ,CAAE,OADmB,CAE7B9F,IAAI,CAAEoE,EAAiB,CAAG,QAAH,CAAc,MAFR,CAAT,CADxB,CAKE,KAAK,CAAuB,QAArB,QAAO7C,EAAP,CAAgCA,CAAhC,OALT,EAOG6C,EAAiB,CAChB7C,CADgB,CAGhB,oBAAC,EAAD,EAAW,SAAS,CAAE/B,WAAW,CAAC,MAAD,CAAjC,CAA2C,IAAI,CAAEgD,EAAjD,EAVJ,CAjFJ,CADF,CAiGGF,CAAO,EACN,oBAAC,YAAD,EACE,SAAS,CAAE9C,WAAW,CAAC,SAAD,CADxB,CAEE,MAAM,CAAEyB,CAAM,EAAID,CAFpB,EAIGsB,CAJH,CAlGJ,CAlBF,CA8HH,CA7YM,CA+YP,MAAO,IAAM0D,UAAS,CAAGhI,UAAU,CAACyB,eAAD,CAA5B,CACP"}
|
|
1
|
+
{"version":3,"file":"TextField.js","names":["IconClear","IconEye","IconEyeClose","IconSelect","React","forwardRef","useCallback","useEffect","TextAreaAutoSize","usePropsHandler","FieldCaption","FieldLabel","useFlag","useForkRef","useKeys","useMutableRef","useSortSteps","cn","getByMap","isString","getTypeForRender","getValueByStep","inputValue","sizeMap","stepIsActive","textFieldPropFormDefault","textFieldPropSizeDefault","textFieldPropViewDefault","COMPONENT_NAME","cnTextField","TextFieldRender","props","ref","textFieldRef","useRef","inputRef","className","type","value","defaultValue","onChange","id","name","rows","cols","minRows","maxRows","inputRefProp","maxLength","disabled","size","view","form","state","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","withClearButton","incrementButtons","max","min","readOnly","required","step","tabIndex","ariaLabel","label","labelIcon","inputContainerRef","labelPosition","caption","iconSizeProp","iconSize","focused","onClick","onKeyDownProp","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onClear","onWheelProp","onWheel","otherProps","focus","setFocus","passwordVisible","setPasswordVisible","withValue","setWithValue","onClickRef","onChangeRef","handleEyeClick","e","stopPropagation","toggle","current","LeftIcon","RightIcon","leftSideIsString","rightSideIsString","sortedSteps","handleChange","target","on","off","handleFocus","commonProps","handleBlur","toString","Eye","isActive","keys","ArrowUp","preventDefault","newValue","ArrowDown","onEvent","textareaProps","inputProps","Array","isArray","blur","handleClear","changeNumberValue","isIncrement","rootProps","position","fn","TextField"],"sources":["../../../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import './TextField.css';\n\nimport { IconClear } from '@consta/icons/IconClear';\nimport { IconEye } from '@consta/icons/IconEye';\nimport { IconEyeClose } from '@consta/icons/IconEyeClose';\nimport { IconSelect } from '@consta/icons/IconSelect';\nimport React, { forwardRef, useCallback, useEffect } from 'react';\nimport TextAreaAutoSize from 'react-textarea-autosize';\n\nimport { usePropsHandler } from '##/components/EventInterceptor/usePropsHandler';\nimport { FieldCaption } from '##/components/FieldCaption/FieldCaption';\nimport { FieldLabel } from '##/components/FieldLabel/FieldLabel';\nimport { useFlag } from '##/hooks/useFlag/useFlag';\nimport { useForkRef } from '##/hooks/useForkRef/useForkRef';\nimport { useKeys } from '##/hooks/useKeys';\nimport { useMutableRef } from '##/hooks/useMutableRef/useMutableRef';\nimport { useSortSteps } from '##/hooks/useSortSteps/useSortSteps';\nimport { cn } from '##/utils/bem';\nimport { getByMap } from '##/utils/getByMap';\nimport { isString } from '##/utils/type-guards';\n\nimport {\n getTypeForRender,\n getValueByStep,\n inputValue,\n sizeMap,\n stepIsActive,\n} from './helpers';\nimport {\n TextFieldComponent,\n textFieldPropFormDefault,\n TextFieldProps,\n textFieldPropSizeDefault,\n textFieldPropViewDefault,\n} from './types';\n\nexport const COMPONENT_NAME = 'TextField' as const;\nexport const cnTextField = cn(COMPONENT_NAME);\n\nexport const TextFieldRender = <TYPE extends string>(\n props: TextFieldProps<TYPE>,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const textFieldRef = React.useRef<HTMLDivElement>(null);\n const inputRef = React.useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n\n const {\n className,\n type = 'text',\n value,\n defaultValue,\n onChange,\n id,\n name,\n rows,\n cols,\n minRows,\n maxRows,\n inputRef: inputRefProp,\n maxLength,\n disabled,\n size = textFieldPropSizeDefault,\n view = textFieldPropViewDefault,\n form = textFieldPropFormDefault,\n state,\n status,\n onBlur,\n onFocus,\n autoFocus = false,\n placeholder,\n leftSide,\n rightSide,\n autoComplete,\n withClearButton,\n incrementButtons: incrementButtonsProp = true,\n max,\n min,\n readOnly,\n required,\n step = 1,\n tabIndex,\n ariaLabel,\n label,\n labelIcon,\n inputContainerRef,\n labelPosition = 'top',\n caption,\n iconSize: iconSizeProp,\n focused,\n onClick,\n // onKey props\n onKeyDown: onKeyDownProp,\n onKeyDownCapture,\n onKeyPress,\n onKeyPressCapture,\n onKeyUp,\n onKeyUpCapture,\n onClear,\n onWheel: onWheelProp,\n ...otherProps\n } = usePropsHandler(COMPONENT_NAME, props, textFieldRef);\n\n const incrementButtons = type === 'number' ? incrementButtonsProp : false;\n\n const [focus, setFocus] = useFlag(autoFocus);\n const [passwordVisible, setPasswordVisible] = useFlag();\n const [withValue, setWithValue] = useFlag();\n\n const onClickRef = useMutableRef(onClick);\n const onChangeRef = useMutableRef(onChange);\n\n const handleEyeClick = useCallback(\n (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n e.stopPropagation();\n setPasswordVisible.toggle();\n inputRef.current?.focus();\n },\n [],\n );\n\n const textarea = type === 'textarea';\n const LeftIcon = leftSide;\n const RightIcon = rightSide;\n const leftSideIsString = isString(leftSide);\n const rightSideIsString = isString(rightSide);\n const iconSize = getByMap(sizeMap, size, iconSizeProp);\n\n const sortedSteps = useSortSteps({\n step,\n min: Number(min),\n max: Number(max),\n });\n\n const handleChange: React.ChangeEventHandler<\n HTMLInputElement | HTMLTextAreaElement\n > = useCallback(\n (e) => {\n !disabled &&\n onChangeRef.current?.(e.target.value || null, {\n e,\n id,\n name,\n });\n\n if (e.target.value) {\n setWithValue.on();\n } else {\n setWithValue.off();\n }\n },\n [id, name, disabled],\n );\n\n const handleBlur: React.FocusEventHandler<HTMLElement> = (e) => {\n setFocus.off();\n onBlur?.(e);\n };\n\n const handleFocus: React.FocusEventHandler<HTMLElement> = (e) => {\n setFocus.on();\n onFocus?.(e);\n };\n\n const commonProps = {\n 'className': cnTextField('Input'),\n 'value': inputValue(value),\n 'defaultValue': inputValue(defaultValue),\n 'onChange': handleChange,\n maxLength,\n disabled,\n 'onBlur': handleBlur,\n 'onFocus': handleFocus,\n autoFocus,\n placeholder,\n autoComplete,\n readOnly,\n tabIndex,\n name,\n onKeyDownCapture,\n onKeyPress,\n onKeyPressCapture,\n onKeyUp,\n onKeyUpCapture,\n 'id': id ? id.toString() : undefined,\n 'aria-label': ariaLabel,\n };\n\n const Eye = passwordVisible ? IconEyeClose : IconEye;\n\n const onKeyDown = useKeys({\n isActive: true,\n keys: {\n ArrowUp: (e) => {\n e.preventDefault();\n if (stepIsActive(step, type, disabled)) {\n const newValue = getValueByStep(\n sortedSteps,\n inputRef.current?.value,\n true,\n min,\n max,\n );\n\n onChangeRef.current?.(newValue, {\n e,\n id,\n name,\n });\n\n if (inputRef.current) {\n inputRef.current.value = newValue;\n setWithValue.on();\n }\n }\n },\n ArrowDown: (e) => {\n e.preventDefault();\n if (stepIsActive(step, type, disabled)) {\n const newValue = getValueByStep(\n sortedSteps,\n inputRef.current?.value,\n false,\n min,\n max,\n );\n\n onChangeRef.current?.(newValue, {\n e,\n id,\n name,\n });\n\n if (inputRef.current) {\n inputRef.current.value = newValue;\n setWithValue.on();\n }\n }\n },\n },\n onEvent: onKeyDownProp,\n });\n\n const onWheel = (e: React.WheelEvent<HTMLInputElement>) => {\n if (onWheelProp) {\n onWheelProp(e);\n } else if (type === 'number') {\n inputRef.current?.blur();\n }\n };\n\n const textareaProps = {\n rows,\n cols,\n minRows: minRows || rows,\n maxRows: maxRows || rows,\n ref: useForkRef([inputRef, inputRefProp]) as (\n node: HTMLTextAreaElement,\n ) => void,\n };\n\n const inputProps = {\n type: getTypeForRender(type, passwordVisible),\n max,\n min,\n step: !Array.isArray(sortedSteps) ? sortedSteps : 0,\n onKeyDown,\n onWheel,\n ref: useForkRef([\n inputRef,\n inputRefProp,\n ]) as React.RefCallback<HTMLInputElement>,\n };\n\n const handleClear = useCallback((e: React.MouseEvent<HTMLButtonElement>) => {\n onChangeRef.current?.(null, {\n e,\n id,\n name,\n });\n\n if (inputRef.current) {\n inputRef.current.value = '';\n setWithValue.off();\n }\n }, []);\n\n const changeNumberValue = (\n e: React.MouseEvent<HTMLButtonElement>,\n isIncrement = true,\n ) => {\n const newValue = getValueByStep(\n sortedSteps,\n inputRef.current?.value,\n isIncrement,\n min,\n max,\n );\n onChangeRef.current?.(newValue, {\n e,\n id,\n name,\n });\n if (inputRef.current) {\n inputRef.current.value = newValue;\n setWithValue.on();\n }\n };\n\n const rootProps = {\n onClick: useCallback((e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n inputRef.current?.focus();\n onClickRef.current?.(e);\n }, []),\n };\n\n useEffect(() => {\n setWithValue[inputRef.current?.value ? 'on' : 'off']();\n }, [inputRef.current?.value]);\n\n return (\n <div\n className={cnTextField({ labelPosition, size, view }, [className])}\n ref={useForkRef([ref, textFieldRef])}\n {...rootProps}\n {...otherProps}\n >\n {label && (\n <FieldLabel\n as=\"label\"\n htmlFor={id?.toString()}\n icon={labelIcon}\n required={required}\n className={cnTextField('Label', { labelPosition })}\n size={size}\n >\n {label}\n </FieldLabel>\n )}\n <div className={cnTextField('Body')}>\n <div\n ref={inputContainerRef}\n className={cnTextField('InputContainer', {\n view,\n form,\n status: status || state,\n disabled,\n type,\n focus: focus || focused,\n withValue,\n incrementButtons: type === 'number' && incrementButtons,\n })}\n >\n {LeftIcon && (\n <div\n className={cnTextField('Side', {\n position: 'left',\n type: leftSideIsString ? 'string' : 'icon',\n })}\n title={typeof leftSide === 'string' ? leftSide : undefined}\n >\n {leftSideIsString ? (\n leftSide\n ) : (\n <LeftIcon className={cnTextField('Icon')} size={iconSize} />\n )}\n </div>\n )}\n {textarea ? (\n <TextAreaAutoSize {...commonProps} {...textareaProps} />\n ) : (\n <input {...commonProps} {...inputProps} />\n )}\n\n {incrementButtons && stepIsActive(step, type, disabled) && (\n <div className={cnTextField('Counter')}>\n <button\n className={cnTextField('CounterButton', { fn: 'increment' })}\n onFocus={handleFocus}\n onClick={(e) => changeNumberValue(e, true)}\n type=\"button\"\n >\n <IconSelect size=\"xs\" />\n </button>\n <button\n className={cnTextField('CounterButton')}\n onFocus={handleFocus}\n onClick={(e) => changeNumberValue(e, false)}\n type=\"button\"\n >\n <IconSelect size=\"xs\" />\n </button>\n </div>\n )}\n\n {!incrementButtons && withValue && withClearButton && !disabled && (\n <button\n type=\"button\"\n disabled={disabled}\n tabIndex={-1}\n onClick={onClear || handleClear}\n className={cnTextField('ClearButton')}\n >\n <IconClear\n size={sizeMap[size]}\n className={cnTextField('ClearButtonIcon')}\n />\n </button>\n )}\n\n {type === 'password' && inputRef.current?.value && (\n <button\n className={cnTextField('ClearButton')}\n type=\"button\"\n onClick={handleEyeClick}\n >\n <Eye className={cnTextField('Icon')} size={iconSize} />\n </button>\n )}\n\n {RightIcon && !incrementButtons && type !== 'password' && (\n <div\n className={cnTextField('Side', {\n position: 'right',\n type: rightSideIsString ? 'string' : 'icon',\n })}\n title={typeof rightSide === 'string' ? rightSide : undefined}\n >\n {rightSideIsString ? (\n rightSide\n ) : (\n <RightIcon className={cnTextField('Icon')} size={iconSize} />\n )}\n </div>\n )}\n </div>\n {caption && (\n <FieldCaption\n className={cnTextField('Caption')}\n status={status || state}\n >\n {caption}\n </FieldCaption>\n )}\n </div>\n </div>\n );\n};\n\nexport const TextField = forwardRef(TextFieldRender) as TextFieldComponent;\nexport * from './types';\n"],"mappings":"ytBAAA,wBAEA,OAASA,SAAT,KAA0B,yBAA1B,CACA,OAASC,OAAT,KAAwB,uBAAxB,CACA,OAASC,YAAT,KAA6B,4BAA7B,CACA,OAASC,UAAT,KAA2B,0BAA3B,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,WAA5B,CAAyCC,SAAzC,KAA0D,OAA1D,CACA,MAAOC,iBAAP,KAA6B,yBAA7B,CAEA,OAASC,eAAT,2CACA,OAASC,YAAT,oCACA,OAASC,UAAT,gCACA,OAASC,OAAT,mCACA,OAASC,UAAT,yCACA,OAASC,OAAT,2BACA,OAASC,aAAT,+CACA,OAASC,YAAT,6CACA,OAASC,EAAT,uBACA,OAASC,QAAT,4BACA,OAASC,QAAT,+BAEA,OACEC,gBADF,CAEEC,cAFF,CAGEC,UAHF,CAIEC,OAJF,CAKEC,YALF,iBAOA,OAEEC,wBAFF,CAIEC,wBAJF,CAKEC,wBALF,eAQA,MAAO,IAAMC,eAAc,CAAG,WAAvB,CACP,MAAO,IAAMC,YAAW,CAAGZ,EAAE,aAAtB,CAEP,MAAO,IAAMa,gBAAe,CAAG,SAC7BC,CAD6B,CAE7BC,CAF6B,CAG1B,SACGC,CAAY,CAAG7B,KAAK,CAAC8B,MAAN,CAA6B,IAA7B,CADlB,CAEGC,CAAQ,CAAG/B,KAAK,CAAC8B,MAAN,CAAqD,IAArD,CAFd,GA0DCzB,eAAe,CAACmB,cAAD,CAAiBG,CAAjB,CAAwBE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|
export declare const sizeMap: Record<TextFieldPropSize, IconPropSize>;
|
|
4
4
|
export declare const getValueByStepArray: (steps: number[], value: string | null | undefined, min: number | string | undefined, max: number | string | undefined, isIncrement: boolean) => number;
|
|
5
5
|
export declare const getValueByStepNumber: (step: number | string, value: string | null | undefined, min: number | string | undefined, max: number | string | undefined, isIncrement: boolean) => number;
|
|
6
|
-
export declare const getTypeForRender: (type: string,
|
|
6
|
+
export declare const getTypeForRender: (type: string, passwordVisible: boolean) => string;
|
|
7
7
|
export declare const getValueByStep: (steps: number | number[], value: string | null | undefined, isIncrement: boolean, min?: number | string, max?: number | string) => string;
|
|
8
8
|
export declare const inputValue: (value?: TextFieldPropValue) => string | undefined;
|
|
9
9
|
export declare const stepIsActive: (step: number | string | number[], type: string, disabled?: boolean) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","names":["sizeMap","xs","s","m","l","getValueByStepArray","steps","value","min","max","isIncrement","currentValue","length","i","getValueByStepNumber","step","minValue","maxValue","Number","isNaN","toFixed","toString","split","getTypeForRender","type","
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["sizeMap","xs","s","m","l","getValueByStepArray","steps","value","min","max","isIncrement","currentValue","length","i","getValueByStepNumber","step","minValue","maxValue","Number","isNaN","toFixed","toString","split","getTypeForRender","type","passwordVisible","getValueByStep","Array","isArray","inputValue","stepIsActive","disabled"],"sources":["../../../../../src/components/TextField/helpers.ts"],"sourcesContent":["import { IconPropSize } from '@consta/icons/Icon';\n\nimport { TextFieldPropSize, TextFieldPropValue } from './types';\n\nexport const sizeMap: Record<TextFieldPropSize, IconPropSize> = {\n xs: 'xs',\n s: 's',\n m: 's',\n l: 'm',\n};\n\nexport const getValueByStepArray = (\n steps: number[],\n value: string | null | undefined,\n min: number | string | undefined,\n max: number | string | undefined,\n isIncrement: boolean,\n): number => {\n const currentValue = Number(value ?? min);\n const minValue = Number(min);\n if (typeof value !== 'string') {\n return typeof min !== 'undefined' ? minValue : 0;\n }\n if (currentValue < steps[0]) {\n return steps[0];\n }\n if (currentValue > steps[steps.length - 1]) {\n return steps[steps.length - 1];\n }\n if (\n (!isIncrement && currentValue === steps[0]) ||\n (isIncrement && currentValue === steps[steps.length - 1])\n ) {\n return currentValue;\n }\n for (let i = 0; i < steps.length; i++) {\n if (\n currentValue === steps[i] ||\n (steps[i] < currentValue && steps[i + 1] > currentValue)\n ) {\n return steps[i + (isIncrement ? 1 : -1)];\n }\n }\n return 0;\n};\n\nexport const getValueByStepNumber = (\n step: number | string,\n value: string | null | undefined,\n min: number | string | undefined,\n max: number | string | undefined,\n isIncrement: boolean,\n): number => {\n const minValue = Number(min);\n const maxValue = Number(max);\n const currentValue: number =\n (typeof value === 'string' ? Number(value) : 0) +\n Number(step) * (isIncrement ? 1 : -1);\n if (!Number.isNaN(minValue) && currentValue <= minValue) {\n return minValue;\n }\n if (!Number.isNaN(maxValue) && currentValue >= maxValue) {\n return maxValue;\n }\n return Number(\n currentValue.toFixed(\n Number(\n /* Необходимо для того, чтобы избежать ситуации, когда по нажатию\nна кнопку прибавляется число с погрешностью.\nЗдесь мы берем разрядность дробной части шага и ограничиваем\nрезультирующее число этой разрядностью */\n Number(step).toString().split('.')[1]?.length,\n ) || 0,\n ),\n );\n};\n\nexport const getTypeForRender = (type: string, passwordVisible: boolean) => {\n if (type !== 'password') {\n return type;\n }\n if (passwordVisible) {\n return 'text';\n }\n return 'password';\n};\n\nexport const getValueByStep = (\n steps: number | number[],\n value: string | null | undefined,\n isIncrement: boolean,\n min?: number | string,\n max?: number | string,\n) => {\n return (\n Array.isArray(steps)\n ? getValueByStepArray(steps, value, min, max, isIncrement)\n : getValueByStepNumber(steps, value, min, max, isIncrement)\n ).toString();\n};\n\nexport const inputValue = (value?: TextFieldPropValue) =>\n value === null ? '' : value;\n\nexport const stepIsActive = (\n step: number | string | number[],\n type: string,\n disabled: boolean = false,\n) => {\n if (type !== 'number' || disabled) {\n return false;\n }\n\n return (\n (typeof step === 'number' && step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AO,IAAMQ,WAAU,CAAG,SAACtB,CAAD,QACd,KAAV,GAAAA,CAAK,CAAY,EAAZ,CAAiBA,CADE,CAAnB,CAGP,MAAO,IAAMuB,aAAY,CAAG,SAC1Bf,CAD0B,CAE1BS,CAF0B,CAIvB,IADHO,EACG,qEACU,QAAT,GAAAP,CAAI,EAAiBO,CADtB,IAMgB,QAAhB,QAAOhB,EAAP,EAAmC,CAAP,CAAAA,CAA7B,EACiB,QAAhB,QAAOA,EAAP,EAA2C,CAAf,EAAOA,CADpC,EAECY,KAAK,CAACC,OAAN,CAAcb,CAAd,GAAuB,CAAC,CAACA,CAAI,CAACH,MAR9B,CAUJ,CAdM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React,{forwardRef}from"react";import{TextFieldTypeNumber}from"./TextFieldTypeNumber";import{TextFieldTypePassword}from"./TextFieldTypePassword";import{TextFieldTypeText}from"./TextFieldTypeText";import{TextFieldTypeTextArea}from"./TextFieldTypeTextArea";import{TextFieldTypeTextArray}from"./TextFieldTypeTextArray";var typeMap={text:TextFieldTypeText,textarea:TextFieldTypeTextArea,password:TextFieldTypePassword,number:TextFieldTypeNumber,textarray:TextFieldTypeTextArray},TextFieldRender=function(a,b){var c=typeMap[a.type||"text"]||typeMap.text;return React.createElement(c,Object.assign({ref:b},a))};export var TextField=forwardRef(TextFieldRender);
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=TextFieldCanary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextFieldCanary.js","names":["React","forwardRef","TextFieldTypeNumber","TextFieldTypePassword","TextFieldTypeText","TextFieldTypeTextArea","TextFieldTypeTextArray","typeMap","text","textarea","password","number","textarray","TextFieldRender","props","ref","Component","type","TextField"],"sources":["../../../../../src/components/TextFieldCanary/TextFieldCanary.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { TextFieldTypeNumber } from './TextFieldTypeNumber';\nimport { TextFieldTypePassword } from './TextFieldTypePassword';\nimport { TextFieldTypeText } from './TextFieldTypeText';\nimport { TextFieldTypeTextArea } from './TextFieldTypeTextArea';\nimport { TextFieldTypeTextArray } from './TextFieldTypeTextArray';\nimport {\n TextFieldComponent,\n TextFieldProps,\n TextFieldTypeComponent,\n} from './types';\n\nconst typeMap: Record<\n string,\n | TextFieldTypeComponent<'text'>\n | TextFieldTypeComponent<'textarea'>\n | TextFieldTypeComponent<'password'>\n | TextFieldTypeComponent<'number'>\n | TextFieldTypeComponent<'textarray'>\n> = {\n text: TextFieldTypeText,\n textarea: TextFieldTypeTextArea,\n password: TextFieldTypePassword,\n number: TextFieldTypeNumber,\n textarray: TextFieldTypeTextArray,\n};\n\nconst TextFieldRender = <TYPE extends string>(\n props: TextFieldProps<TYPE>,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const Component = typeMap[props.type || 'text'] || typeMap.text;\n\n return <Component ref={ref} {...props} />;\n};\n\nexport const TextField = forwardRef(TextFieldRender) as TextFieldComponent;\n"],"mappings":"AAAA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,mBAAT,6BACA,OAASC,qBAAT,+BACA,OAASC,iBAAT,2BACA,OAASC,qBAAT,+BACA,OAASC,sBAAT,gC,GAOMC,QAOL,CAAG,CACFC,IAAI,CAAEJ,iBADJ,CAEFK,QAAQ,CAAEJ,qBAFR,CAGFK,QAAQ,CAAEP,qBAHR,CAIFQ,MAAM,CAAET,mBAJN,CAKFU,SAAS,CAAEN,sBALT,C,CAQEO,eAAe,CAAG,SACtBC,CADsB,CAEtBC,CAFsB,CAGnB,CACH,GAAMC,EAAS,CAAGT,OAAO,CAACO,CAAK,CAACG,IAAN,EAAc,MAAf,CAAP,EAAiCV,OAAO,CAACC,IAA3D,CAEA,MAAO,qBAAC,CAAD,gBAAW,GAAG,CAAEO,CAAhB,EAAyBD,CAAzB,EACR,C,CAED,MAAO,IAAMI,UAAS,CAAGjB,UAAU,CAACY,eAAD,CAA5B"}
|
package/__internal__/src/components/TextFieldCanary/TextFieldTypeNumber/TextFieldTypeNumber.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","value","defaultValue","onChange","id","name","inputRef","maxLength","disabled","size","view","form","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","withClearButton","readOnly","type","tabIndex","ariaLabel","iconSize","onClick","incrementButtons","max","min","step","onKeyDown","onKeyDownCapture","onKeyUp","onKeyUpCapture","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onClear"];import React,{forwardRef,useCallback,useMemo}from"react";import{FieldClearButton,FieldControlLayout,FieldCounter,FieldInput,renderSide}from"../../FieldComponents";import{useForkRef}from"../../../hooks/useForkRef";import{useKeys}from"../../../hooks/useKeys";import{useMutableRef}from"../../../hooks/useMutableRef/useMutableRef";import{useSortSteps}from"../../../hooks/useSortSteps";import{useTextField}from"../useTextField";import{cnTextFieldTypeNumber}from"./cnTextFieldTypeNumber";import{getValueByStep,stepIsActive}from"./helpers";export var TextFieldTypeNumber=forwardRef(function(a,b){var c=a.className,d=a.value,e=a.defaultValue,f=a.onChange,g=a.id,h=a.name,i=a.inputRef,j=a.maxLength,k=a.disabled,l=a.size,m=void 0===l?"m":l,n=a.view,o=void 0===n?"default":n,p=a.form,q=a.status,r=a.onBlur,s=a.onFocus,t=a.autoFocus,u=a.placeholder,v=a.leftSide,w=a.rightSide,x=a.autoComplete,y=a.withClearButton,z=a.readOnly,A=a.type,B=a.tabIndex,C=a.ariaLabel,D=a.iconSize,E=a.onClick,F=a.incrementButtons,G=a.max,H=a.min,I=a.step,J=a.onKeyDown,K=a.onKeyDownCapture,L=a.onKeyUp,M=a.onKeyUpCapture,N=a.onCopy,O=a.onCopyCapture,P=a.onCut,Q=a.onCutCapture,R=a.onPaste,S=a.onPasteCapture,T=a.onClear,U=_objectWithoutProperties(a,_excluded),
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","value","defaultValue","onChange","id","name","inputRef","maxLength","disabled","size","view","form","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","withClearButton","readOnly","type","tabIndex","ariaLabel","iconSize","onClick","incrementButtons","max","min","step","onKeyDown","onKeyDownCapture","onKeyUp","onKeyUpCapture","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onClear","onWheel"];import React,{forwardRef,useCallback,useMemo}from"react";import{FieldClearButton,FieldControlLayout,FieldCounter,FieldInput,renderSide}from"../../FieldComponents";import{useForkRef}from"../../../hooks/useForkRef";import{useKeys}from"../../../hooks/useKeys";import{useMutableRef}from"../../../hooks/useMutableRef/useMutableRef";import{useSortSteps}from"../../../hooks/useSortSteps";import{useTextField}from"../useTextField";import{cnTextFieldTypeNumber}from"./cnTextFieldTypeNumber";import{getValueByStep,stepIsActive}from"./helpers";export var TextFieldTypeNumber=forwardRef(function(a,b){var c=a.className,d=a.value,e=a.defaultValue,f=a.onChange,g=a.id,h=a.name,i=a.inputRef,j=a.maxLength,k=a.disabled,l=a.size,m=void 0===l?"m":l,n=a.view,o=void 0===n?"default":n,p=a.form,q=a.status,r=a.onBlur,s=a.onFocus,t=a.autoFocus,u=a.placeholder,v=a.leftSide,w=a.rightSide,x=a.autoComplete,y=a.withClearButton,z=a.readOnly,A=a.type,B=a.tabIndex,C=a.ariaLabel,D=a.iconSize,E=a.onClick,F=a.incrementButtons,G=a.max,H=a.min,I=a.step,J=a.onKeyDown,K=a.onKeyDownCapture,L=a.onKeyUp,M=a.onKeyUpCapture,N=a.onCopy,O=a.onCopyCapture,P=a.onCut,Q=a.onCutCapture,R=a.onPaste,S=a.onPasteCapture,T=a.onClear,U=a.onWheel,V=_objectWithoutProperties(a,_excluded),W=useTextField({onClick:E,onChange:f,onBlur:r,onFocus:s,disabled:k,onClear:T}),X=W.handleBlur,Y=W.handleChange,Z=W.handleClear,$=W.handleFocus,_=W.focused,aa=W.withValue,ba=W.ref,ca=W.inputRef,da=W.handleClick,ea=W.mutableRefs,fa=W.setWithValue,ga=useSortSteps({step:I,min:H,max:G}),ha=useMutableRef([ga,H,G,J,stepIsActive(ga,k),U]),ia=useCallback(function(a,b){var c,d;if(ca.current&&!ea.current[4]){var e=getValueByStep(ha.current[0],ca.current.value,b,ha.current[1],ha.current[2]);null===(c=(d=ea.current)[0])||void 0===c?void 0:c.call(d,e,{e:a}),ca.current.value=e,fa.on()}},[]),ja=useCallback(function(a){return ia(a,!0)},[]),ka=useCallback(function(a){return ia(a,!1)},[]),la=useKeys(useMemo(function(){return{isActive:!0,keys:{ArrowUp:function ArrowUp(a){a.preventDefault(),ha.current[4]&&ia(a,!0)},ArrowDown:function ArrowDown(a){a.preventDefault(),ha.current[4]&&ia(a,!1)}},onEvent:ha.current[3]}},[])),ma=useCallback(function(a){if(ha.current[5])ha.current[5](a);else{var b;null===(b=ca.current)||void 0===b?void 0:b.blur()}},[]);return React.createElement(FieldControlLayout,Object.assign({},V,{className:cnTextFieldTypeNumber({incrementButtons:F},[c]),form:p,status:q,size:m,leftSide:renderSide(v,m,D),rightSide:[y&&!k&&aa&&!F&&React.createElement(FieldClearButton,{size:m,onClick:Z}),F&&ha.current[4]&&React.createElement(FieldCounter,{onIncrementClick:ja,onIncrementFocus:$,onDecrementClick:ka,onDecrementFocus:$})],focused:_,view:o,ref:useForkRef([b,ba]),disabled:k,onClick:da}),React.createElement(FieldInput,{className:cnTextFieldTypeNumber("Input"),placeholder:u,autoFocus:t,autoComplete:x,onBlur:X,onChange:Y,onFocus:$,defaultValue:e||void 0,value:null===d?"":d,ref:useForkRef([i,ca]),readOnly:z,tabIndex:B,"aria-label":C,onKeyDown:la,onKeyDownCapture:K,onKeyUp:L,onKeyUpCapture:M,onWheel:ma,maxLength:j,disabled:k,type:A,max:G,min:H,id:g,name:h,onCopy:N,onCopyCapture:O,onCut:P,onCutCapture:Q,onPaste:R,onPasteCapture:S}))});
|
|
2
2
|
//# sourceMappingURL=TextFieldTypeNumber.js.map
|
package/__internal__/src/components/TextFieldCanary/TextFieldTypeNumber/TextFieldTypeNumber.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextFieldTypeNumber.js","names":["React","forwardRef","useCallback","useMemo","FieldClearButton","FieldControlLayout","FieldCounter","FieldInput","renderSide","useForkRef","useKeys","useMutableRef","useSortSteps","useTextField","cnTextFieldTypeNumber","getValueByStep","stepIsActive","TextFieldTypeNumber","props","componentRef","className","value","defaultValue","onChange","id","name","inputRefProp","inputRef","maxLength","disabled","size","view","form","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","withClearButton","readOnly","type","tabIndex","ariaLabel","iconSize","onClick","incrementButtons","max","min","step","onKeyDown","onKeyDownCapture","onKeyUp","onKeyUpCapture","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onClear","otherProps","handleBlur","handleChange","handleClear","handleFocus","focused","withValue","ref","handleClick","mutableRefs","setWithValue","sortSteps","refs","changeNumberValue","e","isIncrement","current","newValue","on","handleIncrementButton","handleDecrementButton","handleInputKeyDown","isActive","keys","ArrowUp","preventDefault","ArrowDown","onEvent"],"sources":["../../../../../../src/components/TextFieldCanary/TextFieldTypeNumber/TextFieldTypeNumber.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo } from 'react';\n\nimport {\n FieldClearButton,\n FieldControlLayout,\n FieldCounter,\n FieldInput,\n renderSide,\n} from '##/components/FieldComponents';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { useKeys } from '##/hooks/useKeys';\nimport { useMutableRef } from '##/hooks/useMutableRef/useMutableRef';\nimport { useSortSteps } from '##/hooks/useSortSteps';\n\nimport { TextFieldTypeComponent } from '../types';\nimport { useTextField } from '../useTextField';\nimport { cnTextFieldTypeNumber } from './cnTextFieldTypeNumber';\nimport { getValueByStep, stepIsActive } from './helpers';\n\nexport const TextFieldTypeNumber: TextFieldTypeComponent<'number'> = forwardRef(\n (props, componentRef) => {\n const {\n className,\n value,\n defaultValue,\n onChange,\n id,\n name,\n inputRef: inputRefProp,\n maxLength,\n disabled,\n size = 'm',\n view = 'default',\n form,\n status,\n onBlur,\n onFocus,\n autoFocus,\n placeholder,\n leftSide,\n rightSide,\n autoComplete,\n withClearButton,\n readOnly,\n type,\n tabIndex,\n ariaLabel,\n iconSize,\n onClick,\n incrementButtons,\n max,\n min,\n step,\n // onkey props\n onKeyDown,\n onKeyDownCapture,\n onKeyUp,\n onKeyUpCapture,\n onCopy,\n onCopyCapture,\n onCut,\n onCutCapture,\n onPaste,\n onPasteCapture,\n onClear,\n ...otherProps\n } = props;\n\n const {\n handleBlur,\n handleChange,\n handleClear,\n handleFocus,\n focused,\n withValue,\n ref,\n inputRef,\n handleClick,\n mutableRefs,\n setWithValue,\n } = useTextField({\n onClick,\n onChange,\n onBlur,\n onFocus,\n disabled,\n onClear,\n });\n\n const sortSteps = useSortSteps({ step, min, max });\n\n const refs = useMutableRef([\n sortSteps,\n min,\n max,\n onKeyDown,\n stepIsActive(sortSteps, disabled),\n ] as const);\n\n const changeNumberValue = useCallback(\n <T extends React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent>(\n e: T,\n isIncrement: boolean,\n ) => {\n if (!inputRef.current || mutableRefs.current[4]) {\n return;\n }\n\n const newValue = getValueByStep(\n refs.current[0],\n inputRef.current.value,\n isIncrement,\n refs.current[1],\n refs.current[2],\n );\n\n mutableRefs.current[0]?.(newValue, { e });\n\n inputRef.current.value = newValue;\n setWithValue.on();\n },\n [],\n );\n\n const handleIncrementButton = useCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => changeNumberValue(e, true),\n [],\n );\n\n const handleDecrementButton = useCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => changeNumberValue(e, false),\n [],\n );\n\n const handleInputKeyDown = useKeys(\n useMemo(\n () => ({\n isActive: true,\n keys: {\n ArrowUp: (e) => {\n e.preventDefault();\n refs.current[4] && changeNumberValue(e, true);\n },\n ArrowDown: (e) => {\n e.preventDefault();\n refs.current[4] && changeNumberValue(e, false);\n },\n },\n onEvent: refs.current[3],\n }),\n [],\n ),\n );\n\n return (\n <FieldControlLayout\n {...otherProps}\n className={cnTextFieldTypeNumber({ incrementButtons }, [className])}\n form={form}\n status={status}\n size={size}\n leftSide={renderSide(leftSide, size, iconSize)}\n rightSide={[\n withClearButton && !disabled && withValue && !incrementButtons && (\n <FieldClearButton size={size} onClick={handleClear} />\n ),\n incrementButtons && refs.current[4] && (\n <FieldCounter\n onIncrementClick={handleIncrementButton}\n onIncrementFocus={handleFocus}\n onDecrementClick={handleDecrementButton}\n onDecrementFocus={handleFocus}\n />\n ),\n ]}\n focused={focused}\n view={view}\n ref={useForkRef([componentRef, ref])}\n disabled={disabled}\n onClick={handleClick}\n >\n <FieldInput\n className={cnTextFieldTypeNumber('Input')}\n placeholder={placeholder}\n autoFocus={autoFocus}\n autoComplete={autoComplete}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n defaultValue={defaultValue || undefined}\n value={value === null ? '' : value}\n ref={useForkRef([inputRefProp, inputRef])}\n readOnly={readOnly}\n tabIndex={tabIndex}\n aria-label={ariaLabel}\n onKeyDown={handleInputKeyDown}\n onKeyDownCapture={onKeyDownCapture}\n onKeyUp={onKeyUp}\n onKeyUpCapture={onKeyUpCapture}\n maxLength={maxLength}\n disabled={disabled}\n type={type}\n max={max}\n min={min}\n id={id}\n name={name}\n onCopy={onCopy}\n onCopyCapture={onCopyCapture}\n onCut={onCut}\n onCutCapture={onCutCapture}\n onPaste={onPaste}\n onPasteCapture={onPasteCapture}\n />\n </FieldControlLayout>\n );\n },\n);\n"],"mappings":"ujBAAA,MAAOA,MAAP,EAAgBC,UAAhB,CAA4BC,WAA5B,CAAyCC,OAAzC,KAAwD,OAAxD,CAEA,OACEC,gBADF,CAEEC,kBAFF,CAGEC,YAHF,CAIEC,UAJF,CAKEC,UALF,6BAOA,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AfpB,CAgBE,OAAO,CAAEC,CAhBX,CAiBE,cAAc,CAAEC,CAjBlB,CAkBE,SAAS,CAAE3B,CAlBb,CAmBE,QAAQ,CAAEC,CAnBZ,CAoBE,IAAI,CAAEc,CApBR,CAqBE,GAAG,CAAEM,CArBP,CAsBE,GAAG,CAAEC,CAtBP,CAuBE,EAAE,CAAE1B,CAvBN,CAwBE,IAAI,CAAEC,CAxBR,CAyBE,MAAM,CAAE+B,CAzBV,CA0BE,aAAa,CAAEC,CA1BjB,CA2BE,KAAK,CAAEC,CA3BT,CA4BE,YAAY,CAAEC,CA5BhB,CA6BE,OAAO,CAAEC,CA7BX,CA8BE,cAAc,CAAEC,CA9BlB,EA1BF,CA4DH,CApM4E,CAAxE"}
|
|
1
|
+
{"version":3,"file":"TextFieldTypeNumber.js","names":["React","forwardRef","useCallback","useMemo","FieldClearButton","FieldControlLayout","FieldCounter","FieldInput","renderSide","useForkRef","useKeys","useMutableRef","useSortSteps","useTextField","cnTextFieldTypeNumber","getValueByStep","stepIsActive","TextFieldTypeNumber","props","componentRef","className","value","defaultValue","onChange","id","name","inputRefProp","inputRef","maxLength","disabled","size","view","form","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","withClearButton","readOnly","type","tabIndex","ariaLabel","iconSize","onClick","incrementButtons","max","min","step","onKeyDown","onKeyDownCapture","onKeyUp","onKeyUpCapture","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onClear","onWheel","otherProps","handleBlur","handleChange","handleClear","handleFocus","focused","withValue","ref","handleClick","mutableRefs","setWithValue","sortSteps","refs","changeNumberValue","e","isIncrement","current","newValue","on","handleIncrementButton","handleDecrementButton","handleInputKeyDown","isActive","keys","ArrowUp","preventDefault","ArrowDown","onEvent","handleWheel","blur"],"sources":["../../../../../../src/components/TextFieldCanary/TextFieldTypeNumber/TextFieldTypeNumber.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo } from 'react';\n\nimport {\n FieldClearButton,\n FieldControlLayout,\n FieldCounter,\n FieldInput,\n renderSide,\n} from '##/components/FieldComponents';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { useKeys } from '##/hooks/useKeys';\nimport { useMutableRef } from '##/hooks/useMutableRef/useMutableRef';\nimport { useSortSteps } from '##/hooks/useSortSteps';\n\nimport { TextFieldTypeComponent } from '../types';\nimport { useTextField } from '../useTextField';\nimport { cnTextFieldTypeNumber } from './cnTextFieldTypeNumber';\nimport { getValueByStep, stepIsActive } from './helpers';\n\nexport const TextFieldTypeNumber: TextFieldTypeComponent<'number'> = forwardRef(\n (props, componentRef) => {\n const {\n className,\n value,\n defaultValue,\n onChange,\n id,\n name,\n inputRef: inputRefProp,\n maxLength,\n disabled,\n size = 'm',\n view = 'default',\n form,\n status,\n onBlur,\n onFocus,\n autoFocus,\n placeholder,\n leftSide,\n rightSide,\n autoComplete,\n withClearButton,\n readOnly,\n type,\n tabIndex,\n ariaLabel,\n iconSize,\n onClick,\n incrementButtons,\n max,\n min,\n step,\n // onKey props\n onKeyDown,\n onKeyDownCapture,\n onKeyUp,\n onKeyUpCapture,\n onCopy,\n onCopyCapture,\n onCut,\n onCutCapture,\n onPaste,\n onPasteCapture,\n onClear,\n onWheel,\n ...otherProps\n } = props;\n\n const {\n handleBlur,\n handleChange,\n handleClear,\n handleFocus,\n focused,\n withValue,\n ref,\n inputRef,\n handleClick,\n mutableRefs,\n setWithValue,\n } = useTextField({\n onClick,\n onChange,\n onBlur,\n onFocus,\n disabled,\n onClear,\n });\n\n const sortSteps = useSortSteps({ step, min, max });\n\n const refs = useMutableRef([\n sortSteps,\n min,\n max,\n onKeyDown,\n stepIsActive(sortSteps, disabled),\n onWheel,\n ] as const);\n\n const changeNumberValue = useCallback(\n <T extends React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent>(\n e: T,\n isIncrement: boolean,\n ) => {\n if (!inputRef.current || mutableRefs.current[4]) {\n return;\n }\n\n const newValue = getValueByStep(\n refs.current[0],\n inputRef.current.value,\n isIncrement,\n refs.current[1],\n refs.current[2],\n );\n\n mutableRefs.current[0]?.(newValue, { e });\n\n inputRef.current.value = newValue;\n setWithValue.on();\n },\n [],\n );\n\n const handleIncrementButton = useCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => changeNumberValue(e, true),\n [],\n );\n\n const handleDecrementButton = useCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => changeNumberValue(e, false),\n [],\n );\n\n const handleInputKeyDown = useKeys(\n useMemo(\n () => ({\n isActive: true,\n keys: {\n ArrowUp: (e) => {\n e.preventDefault();\n refs.current[4] && changeNumberValue(e, true);\n },\n ArrowDown: (e) => {\n e.preventDefault();\n refs.current[4] && changeNumberValue(e, false);\n },\n },\n onEvent: refs.current[3],\n }),\n [],\n ),\n );\n\n const handleWheel = useCallback((e: React.WheelEvent<HTMLInputElement>) => {\n if (refs.current[5]) {\n refs.current[5](e);\n } else {\n inputRef.current?.blur();\n }\n }, []);\n\n return (\n <FieldControlLayout\n {...otherProps}\n className={cnTextFieldTypeNumber({ incrementButtons }, [className])}\n form={form}\n status={status}\n size={size}\n leftSide={renderSide(leftSide, size, iconSize)}\n rightSide={[\n withClearButton && !disabled && withValue && !incrementButtons && (\n <FieldClearButton size={size} onClick={handleClear} />\n ),\n incrementButtons && refs.current[4] && (\n <FieldCounter\n onIncrementClick={handleIncrementButton}\n onIncrementFocus={handleFocus}\n onDecrementClick={handleDecrementButton}\n onDecrementFocus={handleFocus}\n />\n ),\n ]}\n focused={focused}\n view={view}\n ref={useForkRef([componentRef, ref])}\n disabled={disabled}\n onClick={handleClick}\n >\n <FieldInput\n className={cnTextFieldTypeNumber('Input')}\n placeholder={placeholder}\n autoFocus={autoFocus}\n autoComplete={autoComplete}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n defaultValue={defaultValue || undefined}\n value={value === null ? '' : value}\n ref={useForkRef([inputRefProp, inputRef])}\n readOnly={readOnly}\n tabIndex={tabIndex}\n aria-label={ariaLabel}\n onKeyDown={handleInputKeyDown}\n onKeyDownCapture={onKeyDownCapture}\n onKeyUp={onKeyUp}\n onKeyUpCapture={onKeyUpCapture}\n onWheel={handleWheel}\n maxLength={maxLength}\n disabled={disabled}\n type={type}\n max={max}\n min={min}\n id={id}\n name={name}\n onCopy={onCopy}\n onCopyCapture={onCopyCapture}\n onCut={onCut}\n onCutCapture={onCutCapture}\n onPaste={onPaste}\n onPasteCapture={onPasteCapture}\n />\n </FieldControlLayout>\n );\n },\n);\n"],"mappings":"ikBAAA,MAAOA,MAAP,EAAgBC,UAAhB,CAA4BC,WAA5B,CAAyCC,OAAzC,KAAwD,OAAxD,CAEA,OACEC,gBADF,CAEEC,kBAFF,CAGEC,YAHF,CAIEC,UAJF,CAKEC,UALF,6BAOA,OAASC,UAAT,iCACA,OAASC,OAAT,8BACA,OAASC,aAAT,kDACA,OAASC,YAAT,mCAGA,OAASC,YAAT,uBACA,OAASC,qBAAT,+BACA,OAASC,cAAT,CAAyBC,YAAzB,iBAEA,MAAO,IAAMC,oBAAqD,CAAGhB,UAAU,CAC7E,SAACiB,CAAD,CAAQC,CAAR,CAAyB,IAErBC,EAFqB,CA+CnBF,CA/CmB,CAErBE,SAFqB,CAGrBC,CAHqB,CA+CnBH,CA/CmB,CAGrBG,KAHqB,CAIrBC,CAJqB,CA+CnBJ,CA/CmB,CAIrBI,YAJqB,CAKrBC,CALqB,CA+CnBL,CA/CmB,CAKrBK,QALqB,CAMrBC,CANqB,CA+CnBN,CA/CmB,CAMrBM,EANqB,CAOrBC,CAPqB,CA+CnBP,CA/CmB,CAOrBO,IAPqB,CAQXC,CARW,CA+CnBR,CA/CmB,CAQrBS,QARqB,CASrBC,CATqB,CA+CnBV,CA/CmB,CASrBU,SATqB,CAUrBC,CAVqB,CA+CnBX,CA/CmB,CAUrBW,QAVqB,GA+CnBX,CA/CmB,CAWrBY,IAXqB,CAWrBA,CAXqB,YAWd,GAXc,KA+CnBZ,CA/CmB,CAYrBa,IAZqB,CAYrBA,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A9BX,CA+BE,cAAc,CAAEC,CA/BlB,EA1BF,CA6DH,CA/M4E,CAAxE"}
|
package/__internal__/src/components/TextFieldCanary/TextFieldTypePassword/TextFieldTypePassword.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","value","defaultValue","onChange","id","name","inputRef","maxLength","disabled","size","view","form","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","withClearButton","readOnly","type","tabIndex","ariaLabel","iconSize","onClick","onKeyDown","onKeyDownCapture","onKeyUp","onKeyUpCapture","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onClear"];import React,{forwardRef}from"react";import{FieldClearButton,FieldControlLayout,FieldInput,FieldToggleVisiblePasswordButton,renderSide}from"../../FieldComponents";import{useFlag}from"../../../hooks/useFlag";import{useForkRef}from"../../../hooks/useForkRef";import{useTextField}from"../useTextField";export var TextFieldTypePassword=forwardRef(function(a,b){var c=a.className,d=a.value,e=a.defaultValue,f=a.onChange,g=a.id,h=a.name,i=a.inputRef,j=a.maxLength,k=a.disabled,l=a.size,m=void 0===l?"m":l,n=a.view,o=void 0===n?"default":n,p=a.form,q=a.status,r=a.onBlur,s=a.onFocus,t=a.autoFocus,u=a.placeholder,v=a.leftSide,w=a.rightSide,x=a.autoComplete,y=a.withClearButton,z=a.readOnly,A=a.type,B=a.tabIndex,C=a.ariaLabel,D=a.iconSize,E=a.onClick,F=a.onKeyDown,G=a.onKeyDownCapture,H=a.onKeyUp,I=a.onKeyUpCapture,J=a.onCopy,K=a.onCopyCapture,L=a.onCut,M=a.onCutCapture,N=a.onPaste,O=a.onPasteCapture,P=a.onClear,Q=_objectWithoutProperties(a,_excluded),
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","value","defaultValue","onChange","id","name","inputRef","maxLength","disabled","size","view","form","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","withClearButton","readOnly","type","tabIndex","ariaLabel","iconSize","onClick","onKeyDown","onKeyDownCapture","onKeyUp","onKeyUpCapture","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onClear","onWheel"];import React,{forwardRef}from"react";import{FieldClearButton,FieldControlLayout,FieldInput,FieldToggleVisiblePasswordButton,renderSide}from"../../FieldComponents";import{useFlag}from"../../../hooks/useFlag";import{useForkRef}from"../../../hooks/useForkRef";import{useTextField}from"../useTextField";export var TextFieldTypePassword=forwardRef(function(a,b){var c=a.className,d=a.value,e=a.defaultValue,f=a.onChange,g=a.id,h=a.name,i=a.inputRef,j=a.maxLength,k=a.disabled,l=a.size,m=void 0===l?"m":l,n=a.view,o=void 0===n?"default":n,p=a.form,q=a.status,r=a.onBlur,s=a.onFocus,t=a.autoFocus,u=a.placeholder,v=a.leftSide,w=a.rightSide,x=a.autoComplete,y=a.withClearButton,z=a.readOnly,A=a.type,B=a.tabIndex,C=a.ariaLabel,D=a.iconSize,E=a.onClick,F=a.onKeyDown,G=a.onKeyDownCapture,H=a.onKeyUp,I=a.onKeyUpCapture,J=a.onCopy,K=a.onCopyCapture,L=a.onCut,M=a.onCutCapture,N=a.onPaste,O=a.onPasteCapture,P=a.onClear,Q=a.onWheel,R=_objectWithoutProperties(a,_excluded),S=useTextField({onClick:E,onChange:f,onBlur:r,onFocus:s,disabled:k,onClear:P}),T=S.handleBlur,U=S.handleChange,V=S.handleClear,W=S.handleFocus,X=S.focused,Y=S.withValue,Z=S.ref,$=S.inputRef,_=S.handleClick,aa=useFlag(),ba=_slicedToArray(aa,2),ca=ba[0],da=ba[1];return React.createElement(FieldControlLayout,Object.assign({},R,{className:c,form:p,status:q,size:m,leftSide:renderSide(v,m,D),rightSide:[y&&!k&&Y&&React.createElement(FieldClearButton,{size:m,onClick:V}),Y&&React.createElement(FieldToggleVisiblePasswordButton,{size:m,onClick:da.toggle,active:ca})],focused:X,view:o,ref:useForkRef([b,Z]),disabled:k,onClick:_}),React.createElement(FieldInput,{type:ca?"text":"password",placeholder:u,autoFocus:t,autoComplete:x,onBlur:T,onChange:U,onFocus:W,defaultValue:e||void 0,value:null===d?"":d,ref:useForkRef([i,$]),readOnly:z,tabIndex:B,"aria-label":C,onKeyDown:F,onKeyDownCapture:G,onKeyUp:H,onKeyUpCapture:I,maxLength:j,disabled:k,id:g,name:h,onCopy:J,onCopyCapture:K,onCut:L,onCutCapture:M,onPaste:N,onPasteCapture:O,onWheel:Q}))});
|
|
2
2
|
//# sourceMappingURL=TextFieldTypePassword.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextFieldTypePassword.js","names":["React","forwardRef","FieldClearButton","FieldControlLayout","FieldInput","FieldToggleVisiblePasswordButton","renderSide","useFlag","useForkRef","useTextField","TextFieldTypePassword","props","componentRef","className","value","defaultValue","onChange","id","name","inputRefProp","inputRef","maxLength","disabled","size","view","form","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","withClearButton","readOnly","type","tabIndex","ariaLabel","iconSize","onClick","onKeyDown","onKeyDownCapture","onKeyUp","onKeyUpCapture","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onClear","otherProps","handleBlur","handleChange","handleClear","handleFocus","focused","withValue","ref","handleClick","visiblePassword","setVisiblePassword","toggle"],"sources":["../../../../../../src/components/TextFieldCanary/TextFieldTypePassword/TextFieldTypePassword.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport {\n FieldClearButton,\n FieldControlLayout,\n FieldInput,\n FieldToggleVisiblePasswordButton,\n renderSide,\n} from '##/components/FieldComponents';\nimport { useFlag } from '##/hooks/useFlag';\nimport { useForkRef } from '##/hooks/useForkRef';\n\nimport { TextFieldTypeComponent } from '..';\nimport { useTextField } from '../useTextField';\n\nexport const TextFieldTypePassword: TextFieldTypeComponent<'password'> =\n forwardRef((props, componentRef) => {\n const {\n className,\n value,\n defaultValue,\n onChange,\n id,\n name,\n inputRef: inputRefProp,\n maxLength,\n disabled,\n size = 'm',\n view = 'default',\n form,\n status,\n onBlur,\n onFocus,\n autoFocus,\n placeholder,\n leftSide,\n rightSide,\n autoComplete,\n withClearButton,\n readOnly,\n type,\n tabIndex,\n ariaLabel,\n iconSize,\n onClick,\n //
|
|
1
|
+
{"version":3,"file":"TextFieldTypePassword.js","names":["React","forwardRef","FieldClearButton","FieldControlLayout","FieldInput","FieldToggleVisiblePasswordButton","renderSide","useFlag","useForkRef","useTextField","TextFieldTypePassword","props","componentRef","className","value","defaultValue","onChange","id","name","inputRefProp","inputRef","maxLength","disabled","size","view","form","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","withClearButton","readOnly","type","tabIndex","ariaLabel","iconSize","onClick","onKeyDown","onKeyDownCapture","onKeyUp","onKeyUpCapture","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onClear","onWheel","otherProps","handleBlur","handleChange","handleClear","handleFocus","focused","withValue","ref","handleClick","visiblePassword","setVisiblePassword","toggle"],"sources":["../../../../../../src/components/TextFieldCanary/TextFieldTypePassword/TextFieldTypePassword.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport {\n FieldClearButton,\n FieldControlLayout,\n FieldInput,\n FieldToggleVisiblePasswordButton,\n renderSide,\n} from '##/components/FieldComponents';\nimport { useFlag } from '##/hooks/useFlag';\nimport { useForkRef } from '##/hooks/useForkRef';\n\nimport { TextFieldTypeComponent } from '..';\nimport { useTextField } from '../useTextField';\n\nexport const TextFieldTypePassword: TextFieldTypeComponent<'password'> =\n forwardRef((props, componentRef) => {\n const {\n className,\n value,\n defaultValue,\n onChange,\n id,\n name,\n inputRef: inputRefProp,\n maxLength,\n disabled,\n size = 'm',\n view = 'default',\n form,\n status,\n onBlur,\n onFocus,\n autoFocus,\n placeholder,\n leftSide,\n rightSide,\n autoComplete,\n withClearButton,\n readOnly,\n type,\n tabIndex,\n ariaLabel,\n iconSize,\n onClick,\n // onKey props\n onKeyDown,\n onKeyDownCapture,\n onKeyUp,\n onKeyUpCapture,\n onCopy,\n onCopyCapture,\n onCut,\n onCutCapture,\n onPaste,\n onPasteCapture,\n onClear,\n onWheel,\n ...otherProps\n } = props;\n\n const {\n handleBlur,\n handleChange,\n handleClear,\n handleFocus,\n focused,\n withValue,\n ref,\n inputRef,\n handleClick,\n } = useTextField({\n onClick,\n onChange,\n onBlur,\n onFocus,\n disabled,\n onClear,\n });\n\n const [visiblePassword, setVisiblePassword] = useFlag();\n\n return (\n <FieldControlLayout\n {...otherProps}\n className={className}\n form={form}\n status={status}\n size={size}\n leftSide={renderSide(leftSide, size, iconSize)}\n rightSide={[\n withClearButton && !disabled && withValue && (\n <FieldClearButton size={size} onClick={handleClear} />\n ),\n withValue && (\n <FieldToggleVisiblePasswordButton\n size={size}\n onClick={setVisiblePassword.toggle}\n active={visiblePassword}\n />\n ),\n ]}\n focused={focused}\n view={view}\n ref={useForkRef([componentRef, ref])}\n disabled={disabled}\n onClick={handleClick}\n >\n <FieldInput\n type={visiblePassword ? 'text' : 'password'}\n placeholder={placeholder}\n autoFocus={autoFocus}\n autoComplete={autoComplete}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n defaultValue={defaultValue || undefined}\n value={value === null ? '' : value}\n ref={useForkRef([inputRefProp, inputRef])}\n readOnly={readOnly}\n tabIndex={tabIndex}\n aria-label={ariaLabel}\n onKeyDown={onKeyDown}\n onKeyDownCapture={onKeyDownCapture}\n onKeyUp={onKeyUp}\n onKeyUpCapture={onKeyUpCapture}\n maxLength={maxLength}\n disabled={disabled}\n id={id}\n name={name}\n onCopy={onCopy}\n onCopyCapture={onCopyCapture}\n onCut={onCut}\n onCutCapture={onCutCapture}\n onPaste={onPaste}\n onPasteCapture={onPasteCapture}\n onWheel={onWheel}\n />\n </FieldControlLayout>\n );\n });\n"],"mappings":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,MAAH,CAAY,UADnC,CAEE,WAAW,CAAEhC,CAFf,CAGE,SAAS,CAAED,CAHb,CAIE,YAAY,CAAEI,CAJhB,CAKE,MAAM,CAAEqB,CALV,CAME,QAAQ,CAAEC,CANZ,CAOE,OAAO,CAAEE,CAPX,CAQE,YAAY,CAAE1C,CAAY,QAR5B,CASE,KAAK,CAAY,IAAV,GAAAD,CAAK,CAAY,EAAZ,CAAiBA,CAT/B,CAUE,GAAG,CAAEN,UAAU,CAAC,CAACW,CAAD,CAAeC,CAAf,CAAD,CAVjB,CAWE,QAAQ,CAAEe,CAXZ,CAYE,QAAQ,CAAEE,CAZZ,CAaE,aAAYC,CAbd,CAcE,SAAS,CAAEG,CAdb,CAeE,gBAAgB,CAAEC,CAfpB,CAgBE,OAAO,CAAEC,CAhBX,CAiBE,cAAc,CAAEC,CAjBlB,CAkBE,SAAS,CAAEvB,CAlBb,CAmBE,QAAQ,CAAEC,CAnBZ,CAoBE,EAAE,CAAEL,CApBN,CAqBE,IAAI,CAAEC,CArBR,CAsBE,MAAM,CAAE2B,CAtBV,CAuBE,aAAa,CAAEC,CAvBjB,CAwBE,KAAK,CAAEC,CAxBT,CAyBE,YAAY,CAAEC,CAzBhB,CA0BE,OAAO,CAAEC,CA1BX,CA2BE,cAAc,CAAEC,CA3BlB,CA4BE,OAAO,CAAEE,CA5BX,EAzBF,CAyDH,CA5HS,CADL"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","value","defaultValue","onChange","id","name","inputRef","maxLength","disabled","size","view","form","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","withClearButton","readOnly","type","tabIndex","ariaLabel","iconSize","onClick","onKeyDown","onKeyDownCapture","onKeyUp","onKeyUpCapture","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onClear"];import React,{forwardRef}from"react";import{FieldClearButton,FieldControlLayout,FieldInput,renderSide}from"../../FieldComponents";import{useForkRef}from"../../../hooks/useForkRef";import{useTextField}from"../useTextField";export var TextFieldTypeText=forwardRef(function(a,b){var c=a.className,d=a.value,e=a.defaultValue,f=a.onChange,g=a.id,h=a.name,i=a.inputRef,j=a.maxLength,k=a.disabled,l=a.size,m=void 0===l?"m":l,n=a.view,o=void 0===n?"default":n,p=a.form,q=a.status,r=a.onBlur,s=a.onFocus,t=a.autoFocus,u=a.placeholder,v=a.leftSide,w=a.rightSide,x=a.autoComplete,y=a.withClearButton,z=a.readOnly,A=a.type,B=void 0===A?"text":A,C=a.tabIndex,D=a.ariaLabel,E=a.iconSize,F=a.onClick,G=a.onKeyDown,H=a.onKeyDownCapture,I=a.onKeyUp,J=a.onKeyUpCapture,K=a.onCopy,L=a.onCopyCapture,M=a.onCut,N=a.onCutCapture,O=a.onPaste,P=a.onPasteCapture,Q=a.onClear,R=_objectWithoutProperties(a,_excluded),
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","value","defaultValue","onChange","id","name","inputRef","maxLength","disabled","size","view","form","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","withClearButton","readOnly","type","tabIndex","ariaLabel","iconSize","onClick","onKeyDown","onKeyDownCapture","onKeyUp","onKeyUpCapture","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onClear","onWheel"];import React,{forwardRef}from"react";import{FieldClearButton,FieldControlLayout,FieldInput,renderSide}from"../../FieldComponents";import{useForkRef}from"../../../hooks/useForkRef";import{useTextField}from"../useTextField";export var TextFieldTypeText=forwardRef(function(a,b){var c=a.className,d=a.value,e=a.defaultValue,f=a.onChange,g=a.id,h=a.name,i=a.inputRef,j=a.maxLength,k=a.disabled,l=a.size,m=void 0===l?"m":l,n=a.view,o=void 0===n?"default":n,p=a.form,q=a.status,r=a.onBlur,s=a.onFocus,t=a.autoFocus,u=a.placeholder,v=a.leftSide,w=a.rightSide,x=a.autoComplete,y=a.withClearButton,z=a.readOnly,A=a.type,B=void 0===A?"text":A,C=a.tabIndex,D=a.ariaLabel,E=a.iconSize,F=a.onClick,G=a.onKeyDown,H=a.onKeyDownCapture,I=a.onKeyUp,J=a.onKeyUpCapture,K=a.onCopy,L=a.onCopyCapture,M=a.onCut,N=a.onCutCapture,O=a.onPaste,P=a.onPasteCapture,Q=a.onClear,R=a.onWheel,S=_objectWithoutProperties(a,_excluded),T=useTextField({onClick:F,onChange:f,onBlur:r,onFocus:s,disabled:k,onClear:Q}),U=T.handleBlur,V=T.handleChange,W=T.handleClear,X=T.handleFocus,Y=T.focused,Z=T.withValue,$=T.ref,_=T.inputRef,aa=T.handleClick;return React.createElement(FieldControlLayout,Object.assign({},S,{className:c,form:p,status:q,size:m,leftSide:renderSide(v,m,E),rightSide:[y&&!k&&Z&&React.createElement(FieldClearButton,{size:m,onClick:W}),renderSide(w,m,E)],focused:Y,view:o,ref:useForkRef([b,$]),disabled:k,onClick:aa}),React.createElement(FieldInput,{placeholder:u,autoFocus:t,autoComplete:x,onBlur:U,onChange:V,onFocus:X,defaultValue:e||void 0,value:null===d?"":d,ref:useForkRef([i,_]),readOnly:z,tabIndex:C,"aria-label":D,onKeyDown:G,onKeyDownCapture:H,onKeyUp:I,onKeyUpCapture:J,maxLength:j,disabled:k,type:B,id:g,name:h,onCopy:K,onCopyCapture:L,onCut:M,onCutCapture:N,onPaste:O,onPasteCapture:P,onWheel:R}))});
|
|
2
2
|
//# sourceMappingURL=TextFieldTypeText.js.map
|
package/__internal__/src/components/TextFieldCanary/TextFieldTypeText/TextFieldTypeText.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextFieldTypeText.js","names":["React","forwardRef","FieldClearButton","FieldControlLayout","FieldInput","renderSide","useForkRef","useTextField","TextFieldTypeText","props","componentRef","className","value","defaultValue","onChange","id","name","inputRefProp","inputRef","maxLength","disabled","size","view","form","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","withClearButton","readOnly","type","tabIndex","ariaLabel","iconSize","onClick","onKeyDown","onKeyDownCapture","onKeyUp","onKeyUpCapture","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onClear","otherProps","handleBlur","handleChange","handleClear","handleFocus","focused","withValue","ref","handleClick"],"sources":["../../../../../../src/components/TextFieldCanary/TextFieldTypeText/TextFieldTypeText.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport {\n FieldClearButton,\n FieldControlLayout,\n FieldInput,\n renderSide,\n} from '##/components/FieldComponents';\nimport { useForkRef } from '##/hooks/useForkRef';\n\nimport { TextFieldTypeComponent } from '..';\nimport { useTextField } from '../useTextField';\n\nexport const TextFieldTypeText: TextFieldTypeComponent<string> = forwardRef(\n (props, componentRef) => {\n const {\n className,\n value,\n defaultValue,\n onChange,\n id,\n name,\n inputRef: inputRefProp,\n maxLength,\n disabled,\n size = 'm',\n view = 'default',\n form,\n status,\n onBlur,\n onFocus,\n autoFocus,\n placeholder,\n leftSide,\n rightSide,\n autoComplete,\n withClearButton,\n readOnly,\n type = 'text',\n tabIndex,\n ariaLabel,\n iconSize,\n onClick,\n //
|
|
1
|
+
{"version":3,"file":"TextFieldTypeText.js","names":["React","forwardRef","FieldClearButton","FieldControlLayout","FieldInput","renderSide","useForkRef","useTextField","TextFieldTypeText","props","componentRef","className","value","defaultValue","onChange","id","name","inputRefProp","inputRef","maxLength","disabled","size","view","form","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","withClearButton","readOnly","type","tabIndex","ariaLabel","iconSize","onClick","onKeyDown","onKeyDownCapture","onKeyUp","onKeyUpCapture","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onClear","onWheel","otherProps","handleBlur","handleChange","handleClear","handleFocus","focused","withValue","ref","handleClick"],"sources":["../../../../../../src/components/TextFieldCanary/TextFieldTypeText/TextFieldTypeText.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport {\n FieldClearButton,\n FieldControlLayout,\n FieldInput,\n renderSide,\n} from '##/components/FieldComponents';\nimport { useForkRef } from '##/hooks/useForkRef';\n\nimport { TextFieldTypeComponent } from '..';\nimport { useTextField } from '../useTextField';\n\nexport const TextFieldTypeText: TextFieldTypeComponent<string> = forwardRef(\n (props, componentRef) => {\n const {\n className,\n value,\n defaultValue,\n onChange,\n id,\n name,\n inputRef: inputRefProp,\n maxLength,\n disabled,\n size = 'm',\n view = 'default',\n form,\n status,\n onBlur,\n onFocus,\n autoFocus,\n placeholder,\n leftSide,\n rightSide,\n autoComplete,\n withClearButton,\n readOnly,\n type = 'text',\n tabIndex,\n ariaLabel,\n iconSize,\n onClick,\n // onKey props\n onKeyDown,\n onKeyDownCapture,\n onKeyUp,\n onKeyUpCapture,\n onCopy,\n onCopyCapture,\n onCut,\n onCutCapture,\n onPaste,\n onPasteCapture,\n onClear,\n onWheel,\n ...otherProps\n } = props;\n\n const {\n handleBlur,\n handleChange,\n handleClear,\n handleFocus,\n focused,\n withValue,\n ref,\n inputRef,\n handleClick,\n } = useTextField({\n onClick,\n onChange,\n onBlur,\n onFocus,\n disabled,\n onClear,\n });\n\n return (\n <FieldControlLayout\n {...otherProps}\n className={className}\n form={form}\n status={status}\n size={size}\n leftSide={renderSide(leftSide, size, iconSize)}\n rightSide={[\n withClearButton && !disabled && withValue && (\n <FieldClearButton size={size} onClick={handleClear} />\n ),\n renderSide(rightSide, size, iconSize),\n ]}\n focused={focused}\n view={view}\n ref={useForkRef([componentRef, ref])}\n disabled={disabled}\n onClick={handleClick}\n >\n <FieldInput\n placeholder={placeholder}\n autoFocus={autoFocus}\n autoComplete={autoComplete}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n defaultValue={defaultValue || undefined}\n value={value === null ? '' : value}\n ref={useForkRef([inputRefProp, inputRef])}\n readOnly={readOnly}\n tabIndex={tabIndex}\n aria-label={ariaLabel}\n onKeyDown={onKeyDown}\n onKeyDownCapture={onKeyDownCapture}\n onKeyUp={onKeyUp}\n onKeyUpCapture={onKeyUpCapture}\n maxLength={maxLength}\n disabled={disabled}\n type={type}\n id={id}\n name={name}\n onCopy={onCopy}\n onCopyCapture={onCopyCapture}\n onCut={onCut}\n onCutCapture={onCutCapture}\n onPaste={onPaste}\n onPasteCapture={onPasteCapture}\n onWheel={onWheel}\n />\n </FieldControlLayout>\n );\n },\n);\n"],"mappings":"2hBAAA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OACEC,gBADF,CAEEC,kBAFF,CAGEC,UAHF,CAIEC,UAJF,6BAMA,OAASC,UAAT,iCAGA,OAASC,YAAT,uBAEA,MAAO,IAAMC,kBAAiD,CAAGP,UAAU,CACzE,SAACQ,CAAD,CAAQC,CAAR,CAAyB,IAErBC,EAFqB,CA2CnBF,CA3CmB,CAErBE,SAFqB,CAGrBC,CAHqB,CA2CnBH,CA3CmB,CAGrBG,KAHqB,CAIrBC,CAJqB,CA2CnBJ,CA3CmB,CAIrBI,YAJqB,CAKrBC,CALqB,CA2CnBL,CA3CmB,CAKrBK,QALqB,CAMrBC,CANqB,CA2CnBN,CA3CmB,CAMrBM,EANqB,CAOrBC,CAPqB,CA2CnBP,CA3CmB,CAOrBO,IAPqB,CAQXC,CARW,CA2CnBR,CA3CmB,CAQrBS,QARqB,CASrBC,CATqB,CA2CnBV,CA3CmB,CASrBU,SATqB,CAUrBC,CAVqB,CA2CnBX,CA3CmB,CAUrBW,QAVqB,GA2CnBX,CA3CmB,CAWrBY,IAXqB,CAWrBA,CAXqB,YAWd,GAXc,KA2CnBZ,CA3CmB,CAYrBa,IAZqB,CAYrBA,CAZqB,YAYd,SAZc,GAarBC,CAbqB,CA2CnBd,CA3CmB,CAarBc,IAbqB,CAcrBC,CAdqB,CA2CnBf,CA3CmB,CAcrBe,MAdqB,CAerBC,CAfqB,CA2CnBhB,CA3CmB,CAerBgB,MAfqB,CAgBrBC,CAhBqB,CA2CnBjB,CA3CmB,CAgBrBiB,OAh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D,CAfjB,CAgBE,QAAQ,CAAEtC,CAhBZ,CAiBE,OAAO,CAAEuC,EAjBX,GAmBE,oBAAC,UAAD,EACE,WAAW,CAAE/B,CADf,CAEE,SAAS,CAAED,CAFb,CAGE,YAAY,CAAEI,CAHhB,CAIE,MAAM,CAAEqB,CAJV,CAKE,QAAQ,CAAEC,CALZ,CAME,OAAO,CAAEE,CANX,CAOE,YAAY,CAAE1C,CAAY,QAP5B,CAQE,KAAK,CAAY,IAAV,GAAAD,CAAK,CAAY,EAAZ,CAAiBA,CAR/B,CASE,GAAG,CAAEN,UAAU,CAAC,CAACW,CAAD,CAAeC,CAAf,CAAD,CATjB,CAUE,QAAQ,CAAEe,CAVZ,CAWE,QAAQ,CAAEE,CAXZ,CAYE,aAAYC,CAZd,CAaE,SAAS,CAAEG,CAbb,CAcE,gBAAgB,CAAEC,CAdpB,CAeE,OAAO,CAAEC,CAfX,CAgBE,cAAc,CAAEC,CAhBlB,CAiBE,SAAS,CAAEvB,CAjBb,CAkBE,QAAQ,CAAEC,CAlBZ,CAmBE,IAAI,CAAEc,CAnBR,CAoBE,EAAE,CAAEnB,CApBN,CAqBE,IAAI,CAAEC,CArBR,CAsBE,MAAM,CAAE2B,CAtBV,CAuBE,aAAa,CAAEC,CAvBjB,CAwBE,KAAK,CAAEC,CAxBT,CAyBE,YAAY,CAAEC,CAzBhB,CA0BE,OAAO,CAAEC,CA1BX,CA2BE,cAAc,CAAEC,CA3BlB,CA4BE,OAAO,CAAEE,CA5BX,EAnBF,CAmDH,CArHwE,CAApE"}
|
package/__internal__/src/components/TextFieldCanary/TextFieldTypeTextArea/TextFieldTypeTextArea.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
.TextFieldTypeTextArea{--text-field-textarea-padding:calc((var(--text-field-textarea-slot-sizes-
|
|
2
|
-
--text-field-
|
|
3
|
-
);--text-field-textarea-
|
|
1
|
+
.TextFieldTypeTextArea{--text-field-textarea-padding:calc((var(--text-field-textarea-slot-sizes-length) + 1)*var(--field-control-layout-space) + var(--text-field-textarea-slot-sizes-width));--text-field-textarea-vertical-padding:calc((var(--field-control-layout-slot-height) - var(--field-control-layout-text-line-height))/2);--text-field-textarea-control-height:var(
|
|
2
|
+
--text-field-height,var(--field-control-layout-height)
|
|
3
|
+
);--text-field-textarea-height-calc:calc(var(--text-field-textarea-control-height) - var(--field-control-layout-border-width)*2);--text-field-textarea-min-height:var(--text-field-textarea-height-calc)}.TextFieldTypeTextArea_resize{--text-field-textarea-resize:vertical}.TextFieldTypeTextArea_resize_auto{--text-field-textarea-height:var(--text-field-textarea-height-calc)}.TextFieldTypeTextArea-TextArea{height:var(--text-field-textarea-height,auto);line-height:var(--field-control-layout-text-line-height);min-height:var(--text-field-textarea-min-height);padding-bottom:var(--text-field-textarea-vertical-padding);padding-right:var(--text-field-textarea-padding,0);padding-top:var(--text-field-textarea-vertical-padding);resize:var(--text-field-textarea-resize,none);width:calc(100% + var(--text-field-textarea-padding))}
|
package/__internal__/src/components/TextFieldCanary/TextFieldTypeTextArea/TextFieldTypeTextArea.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","value","defaultValue","onChange","id","name","inputRef","maxLength","disabled","size","view","form","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","withClearButton","readOnly","type","tabIndex","ariaLabel","iconSize","onClick","resize","rows","minRows","maxRows","onKeyDown","onKeyDownCapture","onKeyUp","onKeyUpCapture","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onClear"];import"./TextFieldTypeTextArea.css";import React,{forwardRef}from"react";import TextAreaAutoSize from"react-textarea-autosize";import{cnFieldInput,FieldClearButton,FieldControlLayout,renderSide}from"../../FieldComponents";import{useForkRef}from"../../../hooks/useForkRef";import{useRefs}from"../../../hooks/useRefs";import{getElementWidth,useResizeObserved}from"../../../hooks/useResizeObserved";import{cnMixScrollBar}from"../../../mixs/MixScrollBar";import{cn}from"../../../utils/bem";import{useTextField}from"../useTextField";export var cnTextFieldTypeTextArea=cn("TextFieldTypeTextArea");export var TextFieldTypeTextArea=forwardRef(function(a,b){var c,d=a.className,e=a.value,f=a.defaultValue,g=a.onChange,h=a.id,i=a.name,j=a.inputRef,k=a.maxLength,l=a.disabled,m=a.size,n=void 0===m?"m":m,o=a.view,p=void 0===o?"default":o,q=a.form,r=a.status,s=a.onBlur,t=a.onFocus,u=a.autoFocus,v=a.placeholder,w=a.leftSide,x=a.rightSide,y=a.autoComplete,z=a.withClearButton,A=a.readOnly,B=a.type,C=a.tabIndex,D=a.ariaLabel,E=a.iconSize,F=a.onClick,G=a.resize,H=a.rows,I=a.minRows,J=a.maxRows,K=a.onKeyDown,L=a.onKeyDownCapture,M=a.onKeyUp,N=a.onKeyUpCapture,O=a.onCopy,P=a.onCopyCapture,Q=a.onCut,R=a.onCutCapture,S=a.onPaste,T=a.onPasteCapture,U=a.onClear,V=_objectWithoutProperties(a,_excluded),
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","value","defaultValue","onChange","id","name","inputRef","maxLength","disabled","size","view","form","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","withClearButton","readOnly","type","tabIndex","ariaLabel","iconSize","onClick","resize","rows","minRows","maxRows","onKeyDown","onKeyDownCapture","onKeyUp","onKeyUpCapture","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onClear","onWheel"];import"./TextFieldTypeTextArea.css";import React,{forwardRef}from"react";import TextAreaAutoSize from"react-textarea-autosize";import{cnFieldInput,FieldClearButton,FieldControlLayout,renderSide}from"../../FieldComponents";import{useForkRef}from"../../../hooks/useForkRef";import{useRefs}from"../../../hooks/useRefs";import{getElementWidth,useResizeObserved}from"../../../hooks/useResizeObserved";import{cnMixScrollBar}from"../../../mixs/MixScrollBar";import{cn}from"../../../utils/bem";import{useTextField}from"../useTextField";export var cnTextFieldTypeTextArea=cn("TextFieldTypeTextArea");export var TextFieldTypeTextArea=forwardRef(function(a,b){var c,d=a.className,e=a.value,f=a.defaultValue,g=a.onChange,h=a.id,i=a.name,j=a.inputRef,k=a.maxLength,l=a.disabled,m=a.size,n=void 0===m?"m":m,o=a.view,p=void 0===o?"default":o,q=a.form,r=a.status,s=a.onBlur,t=a.onFocus,u=a.autoFocus,v=a.placeholder,w=a.leftSide,x=a.rightSide,y=a.autoComplete,z=a.withClearButton,A=a.readOnly,B=a.type,C=a.tabIndex,D=a.ariaLabel,E=a.iconSize,F=a.onClick,G=a.resize,H=a.rows,I=a.minRows,J=a.maxRows,K=a.onKeyDown,L=a.onKeyDownCapture,M=a.onKeyUp,N=a.onKeyUpCapture,O=a.onCopy,P=a.onCopyCapture,Q=a.onCut,R=a.onCutCapture,S=a.onPaste,T=a.onPasteCapture,U=a.onClear,V=a.onWheel,W=_objectWithoutProperties(a,_excluded),X=useTextField({onClick:F,onChange:g,onBlur:s,onFocus:t,disabled:l,onClear:U}),Y=X.handleBlur,Z=X.handleChange,$=X.handleClear,_=X.handleFocus,aa=X.focused,ba=X.withValue,ca=X.ref,da=X.inputRef,ea=X.handleClick,fa=useRefs(2,[!!x,z&&!l&&ba]),ga=useResizeObserved(fa,getElementWidth),ha={className:cnTextFieldTypeTextArea("TextArea",[cnFieldInput(),cnMixScrollBar({size:"xs",trackSize:"native"})]),placeholder:v,autoComplete:y,onBlur:Y,onChange:Z,onFocus:_,defaultValue:f||void 0,value:null===e?"":e,ref:useForkRef([j,da]),readOnly:A,tabIndex:C,"aria-label":D,onKeyDown:K,onKeyDownCapture:L,onKeyUp:M,onKeyUpCapture:N,maxLength:k,disabled:l,id:h,name:i,autoFocus:u,onCopy:O,onCopyCapture:P,onCut:Q,onCutCapture:R,onPaste:S,onPasteCapture:T,onWheel:V};return React.createElement(FieldControlLayout,Object.assign({},W,{className:cnTextFieldTypeTextArea({resize:G},[d]),form:q,status:r,size:n,leftSide:renderSide(w,n,E),rightSide:[z&&!l&&ba&&React.createElement(FieldClearButton,{size:n,onClick:$}),renderSide(x,n,E)],focused:aa,view:p,ref:useForkRef([b,ca]),disabled:l,onClick:ea,style:(c={},_defineProperty(c,"--text-field-textarea-slot-sizes-width","".concat(ga.reduce(function(c,a){return c+a}),"px")),_defineProperty(c,"--text-field-textarea-slot-sizes-length",ga.filter(function(a){return!!a}).length),c),rightSlotsRefs:fa}),"auto"===G?React.createElement(TextAreaAutoSize,Object.assign({},ha,{minRows:I||H,maxRows:J||H})):React.createElement("textarea",Object.assign({},ha,{rows:H})))});
|
|
2
2
|
//# sourceMappingURL=TextFieldTypeTextArea.js.map
|