@wordpress/dataviews 4.17.0 → 4.18.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 +17 -0
- package/build/components/dataviews-item-actions/index.js +2 -1
- package/build/components/dataviews-item-actions/index.js.map +1 -1
- package/build/types.js.map +1 -1
- package/build-module/components/dataviews-item-actions/index.js +2 -1
- package/build-module/components/dataviews-item-actions/index.js.map +1 -1
- package/build-module/types.js.map +1 -1
- package/build-style/style-rtl.css +20 -10
- package/build-style/style.css +20 -10
- package/build-types/components/dataviews/stories/fixtures.d.ts.map +1 -1
- package/build-types/types.d.ts +8 -0
- package/build-types/types.d.ts.map +1 -1
- package/build-wp/index.js +20 -7
- package/package.json +11 -11
- package/src/components/dataviews/stories/fixtures.tsx +1 -0
- package/src/components/dataviews-item-actions/index.tsx +1 -1
- package/src/dataviews-layouts/list/style.scss +23 -11
- package/src/types.ts +12 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -110,7 +110,7 @@ export function ActionModal< Item >( {
|
|
|
110
110
|
title={ action.modalHeader || label }
|
|
111
111
|
__experimentalHideHeader={ !! action.hideModalHeader }
|
|
112
112
|
onRequestClose={ closeModal }
|
|
113
|
-
focusOnMount=
|
|
113
|
+
focusOnMount={ action.modalFocusOnMount ?? true }
|
|
114
114
|
size={ action.modalSize || 'medium' }
|
|
115
115
|
overlayClassName={ `dataviews-action-modal dataviews-action-modal__${ kebabCase(
|
|
116
116
|
action.id
|
|
@@ -16,29 +16,41 @@ div.dataviews-view-list {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
.dataviews-view-list__item-actions {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
display: flex;
|
|
20
|
+
width: max-content;
|
|
21
|
+
flex: 0 0 auto;
|
|
22
|
+
gap: $grid-unit-05;
|
|
23
|
+
|
|
24
|
+
.components-button {
|
|
25
|
+
position: relative;
|
|
26
|
+
z-index: 1;
|
|
27
|
+
}
|
|
21
28
|
|
|
22
29
|
> div {
|
|
23
30
|
height: $button-size-small;
|
|
24
31
|
}
|
|
25
32
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
> :not(:last-child) {
|
|
34
|
+
flex: 0;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
width: 0;
|
|
30
37
|
}
|
|
31
38
|
}
|
|
32
39
|
|
|
33
40
|
&:where(.is-selected, .is-hovered, :focus-within) {
|
|
34
|
-
.dataviews-view-list__item-actions {
|
|
41
|
+
.dataviews-view-list__item-actions > :not(:last-child) {
|
|
35
42
|
flex-basis: min-content;
|
|
43
|
+
width: auto;
|
|
36
44
|
overflow: unset;
|
|
37
|
-
|
|
45
|
+
}
|
|
46
|
+
}
|
|
38
47
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
48
|
+
@media (hover: none) {
|
|
49
|
+
// Show primary action on devices that do not support hover.
|
|
50
|
+
.dataviews-view-list__item-actions > :not(:last-child) {
|
|
51
|
+
flex-basis: min-content;
|
|
52
|
+
width: auto;
|
|
53
|
+
overflow: unset;
|
|
42
54
|
}
|
|
43
55
|
}
|
|
44
56
|
|
package/src/types.ts
CHANGED
|
@@ -8,6 +8,11 @@ import type { ReactElement, ComponentType } from 'react';
|
|
|
8
8
|
*/
|
|
9
9
|
import type { SetSelection } from './private-types';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* WordPress dependencies
|
|
13
|
+
*/
|
|
14
|
+
import type { useFocusOnMount } from '@wordpress/compose';
|
|
15
|
+
|
|
11
16
|
export type SortDirection = 'asc' | 'desc';
|
|
12
17
|
|
|
13
18
|
/**
|
|
@@ -470,6 +475,13 @@ export interface ActionModal< Item > extends ActionBase< Item > {
|
|
|
470
475
|
* @default 'medium'
|
|
471
476
|
*/
|
|
472
477
|
modalSize?: 'small' | 'medium' | 'large' | 'fill';
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* The focus on mount property of the modal.
|
|
481
|
+
*/
|
|
482
|
+
modalFocusOnMount?:
|
|
483
|
+
| Parameters< typeof useFocusOnMount >[ 0 ]
|
|
484
|
+
| 'firstContentElement';
|
|
473
485
|
}
|
|
474
486
|
|
|
475
487
|
export interface ActionButton< Item > extends ActionBase< Item > {
|