Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
gizeasy committed Sep 27, 2023
2 parents 10511fb + ba3bab2 commit 1e839b5
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 34 deletions.
20 changes: 8 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## v4.30.1 (27/09/2023)
- [fix(List): fixed background on ListItem (#3300)](https://github.com/consta-design-system/uikit/commit/6b87a1e491836354e17626440e8adcd14f2b414f) - [@gizeasy](https://github.com/gizeasy)
- [fix(Selects): fix render numbers value (#3297)](https://github.com/consta-design-system/uikit/commit/f129a3482476c59038252295f9a5853c203b12b2) - [@N1MBER](https://github.com/N1MBER)
- [fix(Button): property type set to all places (#3295)](https://github.com/consta-design-system/uikit/commit/ebec6dba46e0fcc789f0f5714348ab906bfb180d) - [@N1MBER](https://github.com/N1MBER)
- [docs(List): remove non exist field from documentation (#3296)](https://github.com/consta-design-system/uikit/commit/f70ea5167e2888489215f8336e7dd8cf9c2dc9d2) - [@N1MBER](https://github.com/N1MBER)

--------------------

## v4.30.0 (20/09/2023)
- [fix(List): fixed render undefined in renderSlot (#3289)](https://github.com/consta-design-system/uikit/commit/78515e8ae5107cc73e4d4f9c84eb6bdf978af8b7) - [@gizeasy](https://github.com/gizeasy)
- [feat(BookmarkTabs): add tab navigation to close button (#3256)](https://github.com/consta-design-system/uikit/commit/3913dc4397e1d773999ac2e0ace5a825681b7aa0) - [@N1MBER](https://github.com/N1MBER)
Expand Down Expand Up @@ -402,15 +410,3 @@

- [feat(ContextMenu): mobile view added (#2872)](https://github.com/consta-design-system/uikit/commit/a46494848d343ed2020bc61cdd37e33ef23394e9) - [@gizeasy](https://github.com/gizeasy)
- [chore(deps): update @consta/icons and @consta/stand](https://github.com/consta-design-system/uikit/commit/3e08155f0dbf660418afce22a179cd8525231c27) - [@gizeasy](https://github.com/gizeasy)

--------------------

## v4.7.1 (25/01/2023)
- Доработали компонент `List` и дополнили документацию
- Заменили собственные списки компонентов `AutoComplete`, `Combobox`, `Select`, `UserSelect`, `ContextMenu` на компонент `List`. Теперь списки будут выглядеть везде одинаково, а бандл станет меньше.
- В `Table` описали ограничения по использованию `getCellWrap`

---

- [feat: migration to List (#2865)](https://github.com/consta-design-system/uikit/commit/6cdf164522150b31d4d6c6f30b34d8e3d661e2db) - [@gizeasy](https://github.com/gizeasy)
- [docs(Table): add description for getCellWrap](https://github.com/consta-design-system/uikit/commit/004bcb9b5015ab90c3ffe65a7db385f2d2e8642e) - [@N1MBER](https://github.com/N1MBER)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@consta/uikit",
"version": "4.30.0",
"version": "4.30.1",
"keywords": [
"ui-kit",
"design-system",
Expand Down
2 changes: 2 additions & 0 deletions src/components/BookmarkTabsCanary/BookmarkTabsCanary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ const BookmarkTabsRender = (
<Button
view="clear"
size="xs"
type="button"
onClick={() => navigate('next')}
iconLeft={IconArrowRight}
onlyIcon
Expand Down Expand Up @@ -200,6 +201,7 @@ const BookmarkTabsRender = (
<Button
view="clear"
size="xs"
type="button"
onClick={onCreate}
iconLeft={IconAdd}
onlyIcon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ const BookmarkTabsTabRender = (
size="xs"
onlyIcon
ref={closeButtonRef}
type="button"
view="clear"
onKeyDown={onCloseKeydown}
tabIndex={-1}
Expand Down
10 changes: 6 additions & 4 deletions src/components/Combobox/Combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { IconClose } from '@consta/icons/IconClose';
import { IconSelect } from '@consta/icons/IconSelect';
import React, { forwardRef, useRef } from 'react';

import { isNotNil } from '##/utils/type-guards';

import { useForkRef } from '../../hooks/useForkRef/useForkRef';
import { useSelect } from '../../hooks/useSelect/useSelect';
import { cnMixFocus } from '../../mixs/MixFocus/MixFocus';
Expand Down Expand Up @@ -201,9 +203,9 @@ const ComboboxRender = <
renderValue({ item, handleRemove: getHandleRemoveValue(item) }),
)}
{isNotMultipleParams(props) &&
props.value &&
isNotNil(props.value) &&
renderValue({ item: props.value })}
{(!value || (Array.isArray(value) && value.length === 0)) &&
{(!isNotNil(value) || (Array.isArray(value) && value.length === 0)) &&
!searchValue &&
placeholder && (
<span className={cnSelect('Placeholder')} title="placeholder">
Expand All @@ -222,7 +224,7 @@ const ComboboxRender = <
ref={inputRefForRender}
className={cnSelect('Input', {
size,
hide: !multiple && !!value,
hide: !multiple && isNotNil(value),
multiple,
})}
value={searchValue}
Expand Down Expand Up @@ -273,7 +275,7 @@ const ComboboxRender = <
</div>
</div>
<span className={cnSelect('Indicators')}>
{value && (
{isNotNil(value) && (
<button
type="button"
onClick={clearValue}
Expand Down
9 changes: 5 additions & 4 deletions src/components/ComboboxCanary/ComboboxCanary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
} from '##/components/SelectComponentsCanary/types';
import { useSelect } from '##/components/SelectComponentsCanary/useSelect';
import { useForkRef } from '##/hooks/useForkRef';
import { isNotNil } from '##/utils/type-guards';

import { Text } from '../Text';
import {
Expand Down Expand Up @@ -209,9 +210,9 @@ const ComboboxRender = <
renderValue({ item, handleRemove: getHandleRemoveValue(item) }),
)}
{isNotMultipleParams(props) &&
props.value &&
isNotNil(props.value) &&
renderValue({ item: props.value })}
{(!value || (Array.isArray(value) && value.length === 0)) &&
{(!isNotNil(value) || (Array.isArray(value) && value.length === 0)) &&
!searchValue &&
placeholder && (
<span className={cnSelect('Placeholder')} title="placeholder">
Expand All @@ -230,7 +231,7 @@ const ComboboxRender = <
ref={inputRefForRender}
className={cnSelect('Input', {
size,
hide: !multiple && !!value,
hide: !multiple && isNotNil(value),
multiple,
})}
value={searchValue}
Expand Down Expand Up @@ -291,7 +292,7 @@ const ComboboxRender = <
</div>
</div>
<span className={cnSelect('Indicators')}>
{value && (
{isNotNil(value) && (
<button
type="button"
onClick={clearValue}
Expand Down
1 change: 0 additions & 1 deletion src/components/ListCanary/__stand__/List.dev.stand.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,6 @@ export type ListPropGetItemRef<ITEM> = (
| [`getGroupLabel?`](#свои-тип-данных-items-и-groups) | `ListPropGetGroupKey<GROUP>` | `(group) => group.id` | Функция для определения названия группы |
| [`getGroupKey?`](#свои-тип-данных-items-и-groups) | `ListPropGetGroupLabel<GROUP>` | `(group) => group.label` | Функция для определения уникального ключа группы |
| [`getGroupRightSide?`](#свои-тип-данных-items-и-groups) | `ListPropGetGroupRightSide<GROUP>` | `(group) => group.rightSide` | Функция для определения контента с правой стороны |
| `isLoading?` | `boolean` | - | При `true` будет отображаться [ListLoader](#загрузчик) |
| `onBlur?` | `(event?: React.FocusEvent<HTMLInputElement>) => void` | - | Обработчик события `blur` |
| `onFocus?` | `(event?: React.FocusEvent<HTMLInputElement>) => void` | - | Обработчик события `focus` |
| `name?` | `string` | - | Имя поля ввода |
Expand Down
6 changes: 4 additions & 2 deletions src/components/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import '../SelectComponents/Select.css';
import { IconSelect } from '@consta/icons/IconSelect';
import React, { forwardRef, useRef } from 'react';

import { isNotNil } from '##/utils/type-guards';

import { useForkRef } from '../../hooks/useForkRef/useForkRef';
import { useSelect } from '../../hooks/useSelect/useSelect';
import { usePropsHandler } from '../EventInterceptor/usePropsHandler';
Expand Down Expand Up @@ -166,8 +168,8 @@ const SelectRender = <ITEM = DefaultItem, GROUP = DefaultGroup>(
className={cnSelect('FakeField')}
readOnly
/>
{value && renderValue({ item: value })}
{(typeof value === 'undefined' || value === null) && placeholder && (
{isNotNil(value) && renderValue({ item: value })}
{!isNotNil(value) && placeholder && (
<span className={cnSelect('Placeholder')} title="placeholder">
{placeholder}
</span>
Expand Down
5 changes: 3 additions & 2 deletions src/components/SelectCanary/SelectCanary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
} from '##/components/SelectComponentsCanary/types';
import { useSelect } from '##/components/SelectComponentsCanary/useSelect';
import { useForkRef } from '##/hooks/useForkRef';
import { isNotNil } from '##/utils/type-guards';

import {
DefaultGroup,
Expand Down Expand Up @@ -180,8 +181,8 @@ const SelectRender = <ITEM = DefaultItem, GROUP = DefaultGroup>(
ref={useForkRef([inputRef, inputRefProp])}
readOnly
/>
{value && renderValue({ item: value })}
{(typeof value === 'undefined' || value === null) && placeholder && (
{isNotNil(value) && renderValue({ item: value })}
{!isNotNil(value) && placeholder && (
<span className={cnSelect('Placeholder')} title="placeholder">
{placeholder}
</span>
Expand Down
1 change: 1 addition & 0 deletions src/components/ThemeToggler/ThemeToggler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ const ThemeTogglerRender = (
iconLeft={getButtonIcon()}
onClick={onButtonClick}
onlyIcon
type="button"
size={size}
view={view}
style={style}
Expand Down
10 changes: 6 additions & 4 deletions src/components/UserSelect/UserSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { IconClose } from '@consta/icons/IconClose';
import { IconSelect } from '@consta/icons/IconSelect';
import React, { forwardRef, useRef } from 'react';

import { isNotNil } from '##/utils/type-guards';

import { useForkRef } from '../../hooks/useForkRef/useForkRef';
import { useSelect } from '../../hooks/useSelect/useSelect';
import { cnMixFocus } from '../../mixs/MixFocus/MixFocus';
Expand Down Expand Up @@ -198,9 +200,9 @@ const UserSelectRender = <
renderValue({ item, handleRemove: getHandleRemoveValue(item) }),
)}
{isNotMultipleParams(props) &&
props.value &&
isNotNil(props.value) &&
renderValue({ item: props.value })}
{(!value || (Array.isArray(value) && value.length === 0)) &&
{(!isNotNil(value) || (Array.isArray(value) && value.length === 0)) &&
!searchValue &&
placeholder && (
<span className={cnSelect('Placeholder')} title="placeholder">
Expand All @@ -219,7 +221,7 @@ const UserSelectRender = <
ref={inputRefForRender}
className={cnSelect('Input', {
size,
hide: !multiple && !!value,
hide: !multiple && isNotNil(value),
multiple,
isUserSelect: true,
})}
Expand Down Expand Up @@ -273,7 +275,7 @@ const UserSelectRender = <
</div>
</div>
<span className={cnSelect('Indicators')}>
{value && (
{isNotNil(value) && (
<button
type="button"
onClick={clearValue}
Expand Down
9 changes: 5 additions & 4 deletions src/components/UserSelectCanary/UserSelectCanary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
import { useSelect } from '##/components/SelectComponentsCanary/useSelect';
import { useForkRef } from '##/hooks/useForkRef';
import { cnMixFocus } from '##/mixs/MixFocus';
import { isNotNil } from '##/utils/type-guards';

import {
DefaultGroup,
Expand Down Expand Up @@ -211,9 +212,9 @@ const UserSelectRender = <
renderValue({ item, handleRemove: getHandleRemoveValue(item) }),
)}
{isNotMultipleParams(props) &&
props.value &&
isNotNil(props.value) &&
renderValue({ item: props.value })}
{(!value || (Array.isArray(value) && value.length === 0)) &&
{(!isNotNil(value) || (Array.isArray(value) && value.length === 0)) &&
!searchValue &&
placeholder && (
<span className={cnSelect('Placeholder')} title="placeholder">
Expand All @@ -232,7 +233,7 @@ const UserSelectRender = <
ref={inputRefForRender}
className={cnSelect('Input', {
size,
hide: !multiple && !!value,
hide: !multiple && isNotNil(value),
multiple,
isUserSelect: true,
})}
Expand Down Expand Up @@ -286,7 +287,7 @@ const UserSelectRender = <
</div>
</div>
<span className={cnSelect('Indicators')}>
{value && (
{isNotNil(value) && (
<button
type="button"
onClick={clearValue}
Expand Down

0 comments on commit 1e839b5

Please sign in to comment.