@cloud-ru/ds-toolbar 2.0.1-preview-7ecd2833.0 → 2.0.2
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/CHANGELOG.md +8 -0
- package/README.md +2 -67
- package/dist/cjs/components/Toolbar/Toolbar.d.ts +1 -1
- package/dist/cjs/components/Toolbar/Toolbar.js +3 -3
- package/dist/cjs/components/Toolbar/types.d.ts +1 -6
- package/dist/esm/components/Toolbar/Toolbar.d.ts +1 -1
- package/dist/esm/components/Toolbar/Toolbar.js +4 -4
- package/dist/esm/components/Toolbar/types.d.ts +1 -6
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +17 -17
- package/src/components/Toolbar/Toolbar.tsx +2 -4
- package/src/components/Toolbar/types.ts +1 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloud-ru/ds-toolbar",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Панель инструментов списков и таблиц — поиск, фильтры, массовые действия, меню «Ещё».",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,22 +41,22 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@cloud-ru/ft-request-payload-transform": "^0.5.0",
|
|
43
43
|
"classnames": "^2.5.1",
|
|
44
|
-
"@cloud-ru/ds-
|
|
45
|
-
"@cloud-ru/ds-
|
|
46
|
-
"@cloud-ru/ds-button": "1.0.4",
|
|
47
|
-
"@cloud-ru/ds-
|
|
48
|
-
"@cloud-ru/ds-
|
|
49
|
-
"@cloud-ru/ds-
|
|
50
|
-
"@cloud-ru/ds-
|
|
51
|
-
"@cloud-ru/ds-
|
|
52
|
-
"@cloud-ru/ds-
|
|
53
|
-
"@cloud-ru/ds-
|
|
54
|
-
"@cloud-ru/ds-
|
|
55
|
-
"@cloud-ru/ds-
|
|
56
|
-
"@cloud-ru/ds-
|
|
57
|
-
"@cloud-ru/ds-
|
|
58
|
-
"@cloud-ru/ds-
|
|
59
|
-
"@cloud-ru/ds-
|
|
44
|
+
"@cloud-ru/ds-adaptive": "^1.0.2",
|
|
45
|
+
"@cloud-ru/ds-bottom-sheet": "^2.0.4",
|
|
46
|
+
"@cloud-ru/ds-button": "^1.0.4",
|
|
47
|
+
"@cloud-ru/ds-icons": "^1.7.0",
|
|
48
|
+
"@cloud-ru/ds-locale": "^1.0.0",
|
|
49
|
+
"@cloud-ru/ds-list": "^3.0.1",
|
|
50
|
+
"@cloud-ru/ds-chips": "^1.2.2",
|
|
51
|
+
"@cloud-ru/ds-materials": "^2.0.1",
|
|
52
|
+
"@cloud-ru/ds-portal-context": "^1.0.2",
|
|
53
|
+
"@cloud-ru/ds-scroll": "^1.0.5",
|
|
54
|
+
"@cloud-ru/ds-search": "^1.0.17",
|
|
55
|
+
"@cloud-ru/ds-segment-control": "^1.0.16",
|
|
56
|
+
"@cloud-ru/ds-tag": "^1.1.15",
|
|
57
|
+
"@cloud-ru/ds-toggles": "^1.1.12",
|
|
58
|
+
"@cloud-ru/ds-tooltip": "^1.0.14",
|
|
59
|
+
"@cloud-ru/ds-utils": "^1.2.0"
|
|
60
60
|
},
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public"
|
|
@@ -18,7 +18,6 @@ import { buildMobileOverflowActions } from './utils/buildMobileOverflowActions';
|
|
|
18
18
|
export function Toolbar<TState extends FiltersState = Record<string, unknown>>({
|
|
19
19
|
className,
|
|
20
20
|
after,
|
|
21
|
-
pinnedAfter,
|
|
22
21
|
dataView,
|
|
23
22
|
outline = true,
|
|
24
23
|
moreActions,
|
|
@@ -55,7 +54,7 @@ export function Toolbar<TState extends FiltersState = Record<string, unknown>>({
|
|
|
55
54
|
const effectiveMoreActions = isMobile ? mobileOverflowActions : moreActions;
|
|
56
55
|
const showMoreActionsMenu = Boolean(effectiveMoreActions?.length);
|
|
57
56
|
const showRefreshButton = Boolean(onRefresh) && !isMobile;
|
|
58
|
-
const showAfterSlot = Boolean(
|
|
57
|
+
const showAfterSlot = Boolean(after) && !isMobile;
|
|
59
58
|
const hasLeftSideElements = showRefreshButton;
|
|
60
59
|
const showDataView = Boolean(dataView?.show);
|
|
61
60
|
const hasRightSideElements = Boolean(showAfterSlot || showDataView || showMoreActionsMenu || filterRowProps);
|
|
@@ -99,8 +98,7 @@ export function Toolbar<TState extends FiltersState = Record<string, unknown>>({
|
|
|
99
98
|
|
|
100
99
|
{showAfterSlot && (
|
|
101
100
|
<div data-test-id={TEST_IDS.after} className={styles.slot}>
|
|
102
|
-
{
|
|
103
|
-
{!isMobile && after}
|
|
101
|
+
{after}
|
|
104
102
|
</div>
|
|
105
103
|
)}
|
|
106
104
|
|
|
@@ -20,13 +20,8 @@ type OptionalProps = {
|
|
|
20
20
|
/** Дополнительный слот между поиском и переключателем вида (+ slotExtraButton в Figma). <br>
|
|
21
21
|
* На mobile-раскладке (из `AdaptiveProvider`) не рендерится в строке — кнопки переносятся в меню «⋯»
|
|
22
22
|
* (`Button` с `onClick` и `label` / `icon` / `aria-label`, одна обёртка вокруг кнопки
|
|
23
|
-
* или элемент с `data-toolbar-after-overflow`). Иначе — в `moreActions`.
|
|
24
|
-
* Чтобы кнопка оставалась в строке и на mobile, передайте её в `pinnedAfter`. */
|
|
23
|
+
* или элемент с `data-toolbar-after-overflow`). Иначе — в `moreActions`. */
|
|
25
24
|
after?: ReactNode;
|
|
26
|
-
/** Закреплённые элементы слота `after`: рендерятся в строке панели на любой раскладке, перед `after`. <br>
|
|
27
|
-
* Принимает то же, что `after`: один элемент, фрагмент или массив. На mobile в меню «⋯» не переносятся —
|
|
28
|
-
* каждая кнопка сужает поле поиска, поэтому закрепляйте только ключевые действия. */
|
|
29
|
-
pinnedAfter?: ReactNode;
|
|
30
25
|
/** Переключатель вида данных — SegmentControl (showDataView в Figma) */
|
|
31
26
|
dataView?: ToolbarDataViewProps;
|
|
32
27
|
/** Элементы выпадающего списка кнопки с действиями */
|