@wordpress/dataviews 4.2.0 → 4.3.1-next.5368f64a9.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/CHANGELOG.md +2 -0
- package/README.md +47 -7
- package/build/components/dataviews/index.js +3 -5
- package/build/components/dataviews/index.js.map +1 -1
- package/build/components/dataviews-bulk-actions/index.js +145 -141
- package/build/components/dataviews-bulk-actions/index.js.map +1 -1
- package/build/components/dataviews-filters/add-filter.js +4 -6
- package/build/components/dataviews-filters/add-filter.js.map +1 -1
- package/build/components/dataviews-filters/search-widget.js +27 -25
- package/build/components/dataviews-filters/search-widget.js.map +1 -1
- package/build/components/dataviews-footer/index.js +45 -0
- package/build/components/dataviews-footer/index.js.map +1 -0
- package/build/components/dataviews-item-actions/index.js +5 -8
- package/build/components/dataviews-item-actions/index.js.map +1 -1
- package/build/components/dataviews-pagination/index.js +4 -4
- package/build/components/dataviews-pagination/index.js.map +1 -1
- package/build/components/dataviews-view-config/index.js +171 -32
- package/build/components/dataviews-view-config/index.js.map +1 -1
- package/build/dataforms-layouts/panel/index.js +4 -1
- package/build/dataforms-layouts/panel/index.js.map +1 -1
- package/build/dataviews-layouts/index.js +48 -2
- package/build/dataviews-layouts/index.js.map +1 -1
- package/build/dataviews-layouts/list/index.js +131 -91
- package/build/dataviews-layouts/list/index.js.map +1 -1
- package/build/dataviews-layouts/table/column-header-menu.js +52 -54
- package/build/dataviews-layouts/table/column-header-menu.js.map +1 -1
- package/build/dataviews-layouts/table/index.js +7 -35
- package/build/dataviews-layouts/table/index.js.map +1 -1
- package/build/normalize-fields.js +4 -2
- package/build/normalize-fields.js.map +1 -1
- package/build/types.js.map +1 -1
- package/build-module/components/dataviews/index.js +3 -5
- package/build-module/components/dataviews/index.js.map +1 -1
- package/build-module/components/dataviews-bulk-actions/index.js +145 -143
- package/build-module/components/dataviews-bulk-actions/index.js.map +1 -1
- package/build-module/components/dataviews-filters/add-filter.js +4 -6
- package/build-module/components/dataviews-filters/add-filter.js.map +1 -1
- package/build-module/components/dataviews-filters/search-widget.js +27 -25
- package/build-module/components/dataviews-filters/search-widget.js.map +1 -1
- package/build-module/components/dataviews-footer/index.js +38 -0
- package/build-module/components/dataviews-footer/index.js.map +1 -0
- package/build-module/components/dataviews-item-actions/index.js +5 -8
- package/build-module/components/dataviews-item-actions/index.js.map +1 -1
- package/build-module/components/dataviews-pagination/index.js +5 -5
- package/build-module/components/dataviews-pagination/index.js.map +1 -1
- package/build-module/components/dataviews-view-config/index.js +177 -38
- package/build-module/components/dataviews-view-config/index.js.map +1 -1
- package/build-module/dataforms-layouts/panel/index.js +4 -1
- package/build-module/dataforms-layouts/panel/index.js.map +1 -1
- package/build-module/dataviews-layouts/index.js +45 -1
- package/build-module/dataviews-layouts/index.js.map +1 -1
- package/build-module/dataviews-layouts/list/index.js +132 -90
- package/build-module/dataviews-layouts/list/index.js.map +1 -1
- package/build-module/dataviews-layouts/table/column-header-menu.js +52 -54
- package/build-module/dataviews-layouts/table/column-header-menu.js.map +1 -1
- package/build-module/dataviews-layouts/table/index.js +9 -37
- package/build-module/dataviews-layouts/table/index.js.map +1 -1
- package/build-module/normalize-fields.js +4 -2
- package/build-module/normalize-fields.js.map +1 -1
- package/build-module/types.js.map +1 -1
- package/build-style/style-rtl.css +79 -67
- package/build-style/style.css +79 -67
- package/build-types/components/dataviews/index.d.ts.map +1 -1
- package/build-types/components/dataviews/stories/fixtures.d.ts +27 -131
- package/build-types/components/dataviews/stories/fixtures.d.ts.map +1 -1
- package/build-types/components/dataviews/stories/index.story.d.ts +13 -53
- package/build-types/components/dataviews/stories/index.story.d.ts.map +1 -1
- package/build-types/components/dataviews-bulk-actions/index.d.ts +11 -1
- package/build-types/components/dataviews-bulk-actions/index.d.ts.map +1 -1
- package/build-types/components/dataviews-filters/add-filter.d.ts.map +1 -1
- package/build-types/components/dataviews-filters/search-widget.d.ts +3 -0
- package/build-types/components/dataviews-filters/search-widget.d.ts.map +1 -1
- package/build-types/components/dataviews-footer/index.d.ts +2 -0
- package/build-types/components/dataviews-footer/index.d.ts.map +1 -0
- package/build-types/components/dataviews-item-actions/index.d.ts.map +1 -1
- package/build-types/components/dataviews-view-config/index.d.ts.map +1 -1
- package/build-types/dataforms-layouts/panel/index.d.ts.map +1 -1
- package/build-types/dataviews-layouts/index.d.ts +4 -2
- package/build-types/dataviews-layouts/index.d.ts.map +1 -1
- package/build-types/dataviews-layouts/list/index.d.ts.map +1 -1
- package/build-types/dataviews-layouts/table/column-header-menu.d.ts.map +1 -1
- package/build-types/dataviews-layouts/table/index.d.ts.map +1 -1
- package/build-types/normalize-fields.d.ts.map +1 -1
- package/build-types/types.d.ts +2 -0
- package/build-types/types.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/components/dataviews/index.tsx +2 -6
- package/src/components/dataviews/stories/fixtures.tsx +698 -0
- package/src/components/dataviews/stories/index.story.tsx +186 -0
- package/src/components/dataviews/stories/style.css +4 -0
- package/src/components/dataviews/style.scss +2 -0
- package/src/components/dataviews-bulk-actions/index.tsx +264 -213
- package/src/components/dataviews-bulk-actions/style.scss +9 -4
- package/src/components/dataviews-filters/add-filter.tsx +7 -11
- package/src/components/dataviews-filters/search-widget.tsx +44 -29
- package/src/components/dataviews-filters/style.scss +12 -2
- package/src/components/dataviews-footer/index.tsx +50 -0
- package/src/components/dataviews-footer/style.scss +40 -0
- package/src/components/dataviews-item-actions/index.tsx +8 -14
- package/src/components/dataviews-pagination/index.tsx +5 -5
- package/src/components/dataviews-pagination/style.scss +0 -19
- package/src/components/dataviews-view-config/index.tsx +252 -53
- package/src/components/dataviews-view-config/style.scss +25 -0
- package/src/dataforms-layouts/panel/index.tsx +2 -0
- package/src/dataviews-layouts/grid/style.scss +1 -1
- package/src/dataviews-layouts/index.ts +63 -2
- package/src/dataviews-layouts/list/index.tsx +210 -139
- package/src/dataviews-layouts/list/style.scss +10 -4
- package/src/dataviews-layouts/table/column-header-menu.tsx +85 -87
- package/src/dataviews-layouts/table/index.tsx +8 -65
- package/src/dataviews-layouts/table/style.scss +0 -9
- package/src/normalize-fields.ts +2 -0
- package/src/style.scss +1 -1
- package/src/types.ts +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/dataviews-bulk-actions-toolbar/index.js +0 -207
- package/build/components/dataviews-bulk-actions-toolbar/index.js.map +0 -1
- package/build-module/components/dataviews-bulk-actions-toolbar/index.js +0 -201
- package/build-module/components/dataviews-bulk-actions-toolbar/index.js.map +0 -1
- package/build-types/components/dataviews-bulk-actions-toolbar/index.d.ts +0 -2
- package/build-types/components/dataviews-bulk-actions-toolbar/index.d.ts.map +0 -1
- package/src/components/dataviews/stories/fixtures.js +0 -250
- package/src/components/dataviews/stories/index.story.js +0 -71
- package/src/components/dataviews-bulk-actions-toolbar/index.tsx +0 -288
- package/src/components/dataviews-bulk-actions-toolbar/style.scss +0 -45
|
@@ -8,28 +8,18 @@ import removeAccents from 'remove-accents';
|
|
|
8
8
|
/**
|
|
9
9
|
* WordPress dependencies
|
|
10
10
|
*/
|
|
11
|
+
import { useInstanceId } from '@wordpress/compose';
|
|
11
12
|
import { __, sprintf } from '@wordpress/i18n';
|
|
12
13
|
import { useState, useMemo, useDeferredValue } from '@wordpress/element';
|
|
13
|
-
import {
|
|
14
|
-
VisuallyHidden,
|
|
15
|
-
Icon,
|
|
16
|
-
privateApis as componentsPrivateApis,
|
|
17
|
-
} from '@wordpress/components';
|
|
14
|
+
import { VisuallyHidden, Icon, Composite } from '@wordpress/components';
|
|
18
15
|
import { search, check } from '@wordpress/icons';
|
|
19
16
|
import { SVG, Circle } from '@wordpress/primitives';
|
|
20
17
|
|
|
21
18
|
/**
|
|
22
19
|
* Internal dependencies
|
|
23
20
|
*/
|
|
24
|
-
import { unlock } from '../../lock-unlock';
|
|
25
21
|
import type { Filter, NormalizedFilter, View } from '../../types';
|
|
26
22
|
|
|
27
|
-
const {
|
|
28
|
-
CompositeV2: Composite,
|
|
29
|
-
CompositeItemV2: CompositeItem,
|
|
30
|
-
useCompositeStoreV2: useCompositeStore,
|
|
31
|
-
} = unlock( componentsPrivateApis );
|
|
32
|
-
|
|
33
23
|
interface SearchWidgetProps {
|
|
34
24
|
view: View;
|
|
35
25
|
filter: NormalizedFilter;
|
|
@@ -84,22 +74,37 @@ const getNewValue = (
|
|
|
84
74
|
return [ value ];
|
|
85
75
|
};
|
|
86
76
|
|
|
77
|
+
function generateFilterElementCompositeItemId(
|
|
78
|
+
prefix: string,
|
|
79
|
+
filterElementValue: string
|
|
80
|
+
) {
|
|
81
|
+
return `${ prefix }-${ filterElementValue }`;
|
|
82
|
+
}
|
|
83
|
+
|
|
87
84
|
function ListBox( { view, filter, onChangeView }: SearchWidgetProps ) {
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
//
|
|
94
|
-
|
|
95
|
-
|
|
85
|
+
const baseId = useInstanceId( ListBox, 'dataviews-filter-list-box' );
|
|
86
|
+
|
|
87
|
+
const [ activeCompositeId, setActiveCompositeId ] = useState<
|
|
88
|
+
string | null | undefined
|
|
89
|
+
>(
|
|
90
|
+
// When there are one or less operators, the first item is set as active
|
|
91
|
+
// (by setting the initial `activeId` to `undefined`).
|
|
92
|
+
// With 2 or more operators, the focus is moved on the operators control
|
|
93
|
+
// (by setting the initial `activeId` to `null`), meaning that there won't
|
|
94
|
+
// be an active item initially. Focus is then managed via the
|
|
95
|
+
// `onFocusVisible` callback.
|
|
96
|
+
filter.operators?.length === 1 ? undefined : null
|
|
97
|
+
);
|
|
96
98
|
const currentFilter = view.filters?.find(
|
|
97
99
|
( f ) => f.field === filter.field
|
|
98
100
|
);
|
|
99
101
|
const currentValue = getCurrentValue( filter, currentFilter );
|
|
100
102
|
return (
|
|
101
103
|
<Composite
|
|
102
|
-
|
|
104
|
+
virtualFocus
|
|
105
|
+
focusLoop
|
|
106
|
+
activeId={ activeCompositeId }
|
|
107
|
+
setActiveId={ setActiveCompositeId }
|
|
103
108
|
role="listbox"
|
|
104
109
|
className="dataviews-filters__search-widget-listbox"
|
|
105
110
|
aria-label={ sprintf(
|
|
@@ -108,18 +113,28 @@ function ListBox( { view, filter, onChangeView }: SearchWidgetProps ) {
|
|
|
108
113
|
filter.name
|
|
109
114
|
) }
|
|
110
115
|
onFocusVisible={ () => {
|
|
111
|
-
|
|
112
|
-
|
|
116
|
+
// `onFocusVisible` needs the `Composite` component to be focusable,
|
|
117
|
+
// which is implicitly achieved via the `virtualFocus` prop.
|
|
118
|
+
if ( ! activeCompositeId && filter.elements.length ) {
|
|
119
|
+
setActiveCompositeId(
|
|
120
|
+
generateFilterElementCompositeItemId(
|
|
121
|
+
baseId,
|
|
122
|
+
filter.elements[ 0 ].value
|
|
123
|
+
)
|
|
124
|
+
);
|
|
113
125
|
}
|
|
114
126
|
} }
|
|
115
|
-
render={ <
|
|
127
|
+
render={ <Composite.Typeahead /> }
|
|
116
128
|
>
|
|
117
129
|
{ filter.elements.map( ( element ) => (
|
|
118
|
-
<
|
|
119
|
-
store={ compositeStore }
|
|
130
|
+
<Composite.Hover
|
|
120
131
|
key={ element.value }
|
|
121
132
|
render={
|
|
122
|
-
<
|
|
133
|
+
<Composite.Item
|
|
134
|
+
id={ generateFilterElementCompositeItemId(
|
|
135
|
+
baseId,
|
|
136
|
+
element.value
|
|
137
|
+
) }
|
|
123
138
|
render={
|
|
124
139
|
<div
|
|
125
140
|
aria-label={ element.label }
|
|
@@ -185,7 +200,7 @@ function ListBox( { view, filter, onChangeView }: SearchWidgetProps ) {
|
|
|
185
200
|
) }
|
|
186
201
|
</span>
|
|
187
202
|
<span>{ element.label }</span>
|
|
188
|
-
</
|
|
203
|
+
</Composite.Hover>
|
|
189
204
|
) ) }
|
|
190
205
|
</Composite>
|
|
191
206
|
);
|
|
@@ -206,7 +221,6 @@ function ComboboxList( { view, filter, onChangeView }: SearchWidgetProps ) {
|
|
|
206
221
|
}, [ filter.elements, deferredSearchValue ] );
|
|
207
222
|
return (
|
|
208
223
|
<Ariakit.ComboboxProvider
|
|
209
|
-
resetValueOnSelect={ false }
|
|
210
224
|
selectedValue={ currentValue }
|
|
211
225
|
setSelectedValue={ ( value ) => {
|
|
212
226
|
const newFilters = currentFilter
|
|
@@ -266,6 +280,7 @@ function ComboboxList( { view, filter, onChangeView }: SearchWidgetProps ) {
|
|
|
266
280
|
{ matches.map( ( element ) => {
|
|
267
281
|
return (
|
|
268
282
|
<Ariakit.ComboboxItem
|
|
283
|
+
resetValueOnSelect={ false }
|
|
269
284
|
key={ element.value }
|
|
270
285
|
value={ element.value }
|
|
271
286
|
className="dataviews-filters__search-widget-listitem"
|
|
@@ -18,11 +18,19 @@
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.dataviews-filters__summary-popover {
|
|
21
|
+
font-size: $default-font-size;
|
|
22
|
+
line-height: $default-line-height;
|
|
23
|
+
|
|
21
24
|
.components-popover__content {
|
|
22
25
|
width: 230px;
|
|
23
|
-
padding: 0;
|
|
24
26
|
border-radius: $grid-unit-05;
|
|
25
27
|
}
|
|
28
|
+
|
|
29
|
+
&.components-dropdown__content {
|
|
30
|
+
.components-popover__content {
|
|
31
|
+
padding: 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
26
34
|
}
|
|
27
35
|
|
|
28
36
|
.dataviews-filters__summary-operators-container {
|
|
@@ -57,6 +65,7 @@
|
|
|
57
65
|
position: relative;
|
|
58
66
|
display: flex;
|
|
59
67
|
align-items: center;
|
|
68
|
+
box-sizing: border-box;
|
|
60
69
|
|
|
61
70
|
&.has-reset {
|
|
62
71
|
padding-inline-end: $button-size-small + $grid-unit-05;
|
|
@@ -160,7 +169,7 @@
|
|
|
160
169
|
display: flex;
|
|
161
170
|
align-items: center;
|
|
162
171
|
gap: $grid-unit-10;
|
|
163
|
-
border-radius: $radius-
|
|
172
|
+
border-radius: $radius-small;
|
|
164
173
|
box-sizing: border-box;
|
|
165
174
|
padding: $grid-unit-10 $grid-unit-15;
|
|
166
175
|
cursor: default;
|
|
@@ -275,6 +284,7 @@
|
|
|
275
284
|
font-size: 11px;
|
|
276
285
|
outline: var(--wp-admin-border-width-focus) solid $white;
|
|
277
286
|
color: $white;
|
|
287
|
+
box-sizing: border-box;
|
|
278
288
|
}
|
|
279
289
|
|
|
280
290
|
.dataviews-search {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __experimentalHStack as HStack } from '@wordpress/components';
|
|
5
|
+
import { useContext } from '@wordpress/element';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import DataViewsContext from '../dataviews-context';
|
|
11
|
+
import DataViewsPagination from '../dataviews-pagination';
|
|
12
|
+
import {
|
|
13
|
+
BulkActionsFooter,
|
|
14
|
+
useSomeItemHasAPossibleBulkAction,
|
|
15
|
+
} from '../dataviews-bulk-actions';
|
|
16
|
+
import { LAYOUT_GRID, LAYOUT_TABLE } from '../../constants';
|
|
17
|
+
|
|
18
|
+
const EMPTY_ARRAY: [] = [];
|
|
19
|
+
|
|
20
|
+
export default function DataViewsFooter() {
|
|
21
|
+
const {
|
|
22
|
+
view,
|
|
23
|
+
paginationInfo: { totalItems = 0, totalPages },
|
|
24
|
+
data,
|
|
25
|
+
actions = EMPTY_ARRAY,
|
|
26
|
+
} = useContext( DataViewsContext );
|
|
27
|
+
const hasBulkActions =
|
|
28
|
+
useSomeItemHasAPossibleBulkAction( actions, data ) &&
|
|
29
|
+
[ LAYOUT_TABLE, LAYOUT_GRID ].includes( view.type );
|
|
30
|
+
|
|
31
|
+
if (
|
|
32
|
+
! totalItems ||
|
|
33
|
+
! totalPages ||
|
|
34
|
+
( totalPages <= 1 && ! hasBulkActions )
|
|
35
|
+
) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return (
|
|
39
|
+
!! totalItems && (
|
|
40
|
+
<HStack
|
|
41
|
+
expanded={ false }
|
|
42
|
+
justify="end"
|
|
43
|
+
className="dataviews-footer"
|
|
44
|
+
>
|
|
45
|
+
{ hasBulkActions && <BulkActionsFooter /> }
|
|
46
|
+
<DataViewsPagination />
|
|
47
|
+
</HStack>
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.dataviews-footer {
|
|
2
|
+
position: sticky;
|
|
3
|
+
bottom: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
background-color: $white;
|
|
6
|
+
padding: $grid-unit-15 $grid-unit-60;
|
|
7
|
+
border-top: $border-width solid $gray-100;
|
|
8
|
+
flex-shrink: 0;
|
|
9
|
+
transition: padding ease-out 0.1s;
|
|
10
|
+
@include reduce-motion("transition");
|
|
11
|
+
z-index: z-index(".dataviews-footer");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/* stylelint-disable-next-line scss/at-rule-no-unknown -- '@container' not globally permitted */
|
|
16
|
+
@container (max-width: 430px) {
|
|
17
|
+
.dataviews-footer {
|
|
18
|
+
padding: $grid-unit-15 $grid-unit-30;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* stylelint-disable-next-line scss/at-rule-no-unknown -- '@container' not globally permitted */
|
|
23
|
+
@container (max-width: 560px) {
|
|
24
|
+
.dataviews-footer {
|
|
25
|
+
flex-direction: column !important;
|
|
26
|
+
|
|
27
|
+
.dataviews-bulk-actions-footer__container {
|
|
28
|
+
width: 100%;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.dataviews-bulk-actions-footer__item-count {
|
|
32
|
+
flex-grow: 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.dataviews-pagination {
|
|
36
|
+
width: 100%;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -23,13 +23,7 @@ import { useRegistry } from '@wordpress/data';
|
|
|
23
23
|
import { unlock } from '../../lock-unlock';
|
|
24
24
|
import type { Action, ActionModal as ActionModalType } from '../../types';
|
|
25
25
|
|
|
26
|
-
const {
|
|
27
|
-
DropdownMenuV2: DropdownMenu,
|
|
28
|
-
DropdownMenuGroupV2: DropdownMenuGroup,
|
|
29
|
-
DropdownMenuItemV2: DropdownMenuItem,
|
|
30
|
-
DropdownMenuItemLabelV2: DropdownMenuItemLabel,
|
|
31
|
-
kebabCase,
|
|
32
|
-
} = unlock( componentsPrivateApis );
|
|
26
|
+
const { DropdownMenuV2, kebabCase } = unlock( componentsPrivateApis );
|
|
33
27
|
|
|
34
28
|
export interface ActionTriggerProps< Item > {
|
|
35
29
|
action: Action< Item >;
|
|
@@ -91,12 +85,12 @@ function DropdownMenuItemTrigger< Item >( {
|
|
|
91
85
|
const label =
|
|
92
86
|
typeof action.label === 'string' ? action.label : action.label( items );
|
|
93
87
|
return (
|
|
94
|
-
<
|
|
88
|
+
<DropdownMenuV2.Item
|
|
95
89
|
onClick={ onClick }
|
|
96
90
|
hideOnClick={ ! ( 'RenderModal' in action ) }
|
|
97
91
|
>
|
|
98
|
-
<
|
|
99
|
-
</
|
|
92
|
+
<DropdownMenuV2.ItemLabel>{ label }</DropdownMenuV2.ItemLabel>
|
|
93
|
+
</DropdownMenuV2.Item>
|
|
100
94
|
);
|
|
101
95
|
}
|
|
102
96
|
|
|
@@ -158,7 +152,7 @@ export function ActionsDropdownMenuGroup< Item >( {
|
|
|
158
152
|
}: ActionsDropdownMenuGroupProps< Item > ) {
|
|
159
153
|
const registry = useRegistry();
|
|
160
154
|
return (
|
|
161
|
-
<
|
|
155
|
+
<DropdownMenuV2.Group>
|
|
162
156
|
{ actions.map( ( action ) => {
|
|
163
157
|
if ( 'RenderModal' in action ) {
|
|
164
158
|
return (
|
|
@@ -181,7 +175,7 @@ export function ActionsDropdownMenuGroup< Item >( {
|
|
|
181
175
|
/>
|
|
182
176
|
);
|
|
183
177
|
} ) }
|
|
184
|
-
</
|
|
178
|
+
</DropdownMenuV2.Group>
|
|
185
179
|
);
|
|
186
180
|
}
|
|
187
181
|
|
|
@@ -251,7 +245,7 @@ function CompactItemActions< Item >( {
|
|
|
251
245
|
actions,
|
|
252
246
|
}: CompactItemActionsProps< Item > ) {
|
|
253
247
|
return (
|
|
254
|
-
<
|
|
248
|
+
<DropdownMenuV2
|
|
255
249
|
trigger={
|
|
256
250
|
<Button
|
|
257
251
|
size="compact"
|
|
@@ -265,6 +259,6 @@ function CompactItemActions< Item >( {
|
|
|
265
259
|
placement="bottom-end"
|
|
266
260
|
>
|
|
267
261
|
<ActionsDropdownMenuGroup actions={ actions } item={ item } />
|
|
268
|
-
</
|
|
262
|
+
</DropdownMenuV2>
|
|
269
263
|
);
|
|
270
264
|
}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
SelectControl,
|
|
8
8
|
} from '@wordpress/components';
|
|
9
9
|
import { createInterpolateElement, memo, useContext } from '@wordpress/element';
|
|
10
|
-
import { sprintf, __, _x } from '@wordpress/i18n';
|
|
10
|
+
import { sprintf, __, _x, isRTL } from '@wordpress/i18n';
|
|
11
11
|
import { next, previous } from '@wordpress/icons';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -51,9 +51,9 @@ function DataViewsPagination() {
|
|
|
51
51
|
totalPages !== 1 && (
|
|
52
52
|
<HStack
|
|
53
53
|
expanded={ false }
|
|
54
|
-
spacing={ 6 }
|
|
55
|
-
justify="end"
|
|
56
54
|
className="dataviews-pagination"
|
|
55
|
+
justify="end"
|
|
56
|
+
spacing={ 6 }
|
|
57
57
|
>
|
|
58
58
|
<HStack
|
|
59
59
|
justify="flex-start"
|
|
@@ -103,7 +103,7 @@ function DataViewsPagination() {
|
|
|
103
103
|
disabled={ currentPage === 1 }
|
|
104
104
|
accessibleWhenDisabled
|
|
105
105
|
label={ __( 'Previous page' ) }
|
|
106
|
-
icon={ previous }
|
|
106
|
+
icon={ isRTL() ? next : previous }
|
|
107
107
|
showTooltip
|
|
108
108
|
size="compact"
|
|
109
109
|
tooltipPosition="top"
|
|
@@ -115,7 +115,7 @@ function DataViewsPagination() {
|
|
|
115
115
|
disabled={ currentPage >= totalPages }
|
|
116
116
|
accessibleWhenDisabled
|
|
117
117
|
label={ __( 'Next page' ) }
|
|
118
|
-
icon={ next }
|
|
118
|
+
icon={ isRTL() ? previous : next }
|
|
119
119
|
showTooltip
|
|
120
120
|
size="compact"
|
|
121
121
|
tooltipPosition="top"
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
.dataviews-pagination {
|
|
2
|
-
position: sticky;
|
|
3
|
-
bottom: 0;
|
|
4
|
-
left: 0;
|
|
5
|
-
background-color: $white;
|
|
6
|
-
padding: $grid-unit-15 $grid-unit-60;
|
|
7
|
-
border-top: $border-width solid $gray-100;
|
|
8
|
-
flex-shrink: 0;
|
|
9
|
-
transition: padding ease-out 0.1s;
|
|
10
|
-
@include reduce-motion("transition");
|
|
11
|
-
}
|
|
12
|
-
|
|
13
1
|
.dataviews-pagination__page-select {
|
|
14
2
|
font-size: 11px;
|
|
15
3
|
font-weight: 500;
|
|
@@ -22,10 +10,3 @@
|
|
|
22
10
|
}
|
|
23
11
|
}
|
|
24
12
|
}
|
|
25
|
-
|
|
26
|
-
/* stylelint-disable-next-line scss/at-rule-no-unknown -- '@container' not globally permitted */
|
|
27
|
-
@container (max-width: 430px) {
|
|
28
|
-
.dataviews-pagination {
|
|
29
|
-
padding: $grid-unit-15 $grid-unit-30;
|
|
30
|
-
}
|
|
31
|
-
}
|