@wordpress/dataviews 17.0.1-next.v.202606191442.0 → 17.0.1
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 +3 -1
- package/build/components/dataform-layouts/panel/dropdown.cjs +2 -2
- package/build/components/dataform-layouts/panel/dropdown.cjs.map +2 -2
- package/build/components/dataform-layouts/panel/modal.cjs +1 -1
- package/build/components/dataform-layouts/panel/modal.cjs.map +2 -2
- package/build/components/dataform-layouts/panel/summary-button.cjs +7 -6
- package/build/components/dataform-layouts/panel/summary-button.cjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/dropdown.mjs +2 -2
- package/build-module/components/dataform-layouts/panel/dropdown.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/modal.mjs +1 -1
- package/build-module/components/dataform-layouts/panel/modal.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/summary-button.mjs +7 -6
- package/build-module/components/dataform-layouts/panel/summary-button.mjs.map +2 -2
- package/build-style/style-rtl.css +29 -32
- package/build-style/style.css +29 -32
- package/build-types/components/dataform-layouts/panel/summary-button.d.ts +2 -2
- package/build-types/components/dataform-layouts/panel/summary-button.d.ts.map +1 -1
- package/build-wp/index.js +416 -353
- package/package.json +16 -16
- package/src/components/dataform-layouts/panel/dropdown.tsx +1 -1
- package/src/components/dataform-layouts/panel/modal.tsx +1 -1
- package/src/components/dataform-layouts/panel/style.scss +1 -4
- package/src/components/dataform-layouts/panel/summary-button.tsx +17 -7
- package/src/components/dataviews-filters/style.scss +1 -1
- package/src/components/dataviews-layouts/activity/style.scss +8 -8
- package/src/components/dataviews-layouts/grid/style.scss +7 -1
- package/src/components/dataviews-layouts/list/style.scss +15 -6
- package/src/components/dataviews-layouts/picker-activity/style.scss +8 -8
- package/src/components/dataviews-layouts/picker-grid/style.scss +8 -2
- package/src/components/dataviews-layouts/picker-table/style.scss +3 -1
- package/src/dataviews/style.scss +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/dataviews",
|
|
3
|
-
"version": "17.0.1
|
|
3
|
+
"version": "17.0.1",
|
|
4
4
|
"description": "DataViews is a component that provides an API to render datasets using different types of layouts (table, grid, list, etc.).",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -52,20 +52,20 @@
|
|
|
52
52
|
"sideEffects": false,
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@ariakit/react": "^0.4.29",
|
|
55
|
-
"@wordpress/base-styles": "^10.
|
|
56
|
-
"@wordpress/components": "^
|
|
57
|
-
"@wordpress/compose": "^8.
|
|
58
|
-
"@wordpress/data": "^10.
|
|
59
|
-
"@wordpress/date": "^5.
|
|
60
|
-
"@wordpress/deprecated": "^4.
|
|
61
|
-
"@wordpress/element": "^8.
|
|
62
|
-
"@wordpress/i18n": "^6.
|
|
63
|
-
"@wordpress/icons": "^
|
|
64
|
-
"@wordpress/keycodes": "^4.
|
|
65
|
-
"@wordpress/primitives": "^4.
|
|
66
|
-
"@wordpress/private-apis": "^1.
|
|
67
|
-
"@wordpress/ui": "^0.16.1
|
|
68
|
-
"@wordpress/warning": "^3.
|
|
55
|
+
"@wordpress/base-styles": "^10.1.0",
|
|
56
|
+
"@wordpress/components": "^36.0.1",
|
|
57
|
+
"@wordpress/compose": "^8.2.0",
|
|
58
|
+
"@wordpress/data": "^10.49.0",
|
|
59
|
+
"@wordpress/date": "^5.49.0",
|
|
60
|
+
"@wordpress/deprecated": "^4.49.0",
|
|
61
|
+
"@wordpress/element": "^8.1.0",
|
|
62
|
+
"@wordpress/i18n": "^6.22.0",
|
|
63
|
+
"@wordpress/icons": "^15.0.0",
|
|
64
|
+
"@wordpress/keycodes": "^4.49.0",
|
|
65
|
+
"@wordpress/primitives": "^4.49.0",
|
|
66
|
+
"@wordpress/private-apis": "^1.49.0",
|
|
67
|
+
"@wordpress/ui": "^0.16.1",
|
|
68
|
+
"@wordpress/warning": "^3.49.0",
|
|
69
69
|
"clsx": "^2.1.1",
|
|
70
70
|
"colord": "^2.9.3",
|
|
71
71
|
"date-fns": "^4.1.0",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"scripts": {
|
|
101
101
|
"build:wp": "node build.cjs"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "9a75283890dda96ae1d37197b5070fae8c9cf66f"
|
|
104
104
|
}
|
|
@@ -152,8 +152,8 @@ function PanelDropdown< Item >( {
|
|
|
152
152
|
validity={ validity }
|
|
153
153
|
touched={ touched }
|
|
154
154
|
disabled={ fieldDefinition.readOnly === true }
|
|
155
|
+
isOpen={ isOpen }
|
|
155
156
|
onClick={ onToggle }
|
|
156
|
-
aria-expanded={ isOpen }
|
|
157
157
|
/>
|
|
158
158
|
) }
|
|
159
159
|
renderContent={ ( { onClose } ) => (
|
|
@@ -107,14 +107,11 @@
|
|
|
107
107
|
position: relative;
|
|
108
108
|
z-index: 1;
|
|
109
109
|
cursor: help;
|
|
110
|
-
|
|
110
|
+
color: var(--wpds-color-foreground-content-error-weak);
|
|
111
111
|
display: inline-flex;
|
|
112
112
|
flex-direction: row;
|
|
113
113
|
align-items: center;
|
|
114
114
|
gap: var(--wpds-dimension-gap-xs);
|
|
115
|
-
svg {
|
|
116
|
-
fill: currentColor;
|
|
117
|
-
}
|
|
118
115
|
}
|
|
119
116
|
|
|
120
117
|
.dataforms-layouts-panel__field-control {
|
|
@@ -34,8 +34,8 @@ export default function SummaryButton< Item >( {
|
|
|
34
34
|
validity,
|
|
35
35
|
touched,
|
|
36
36
|
disabled,
|
|
37
|
+
isOpen,
|
|
37
38
|
onClick,
|
|
38
|
-
'aria-expanded': ariaExpanded,
|
|
39
39
|
}: {
|
|
40
40
|
data: Item;
|
|
41
41
|
field: NormalizedFormField;
|
|
@@ -44,8 +44,8 @@ export default function SummaryButton< Item >( {
|
|
|
44
44
|
validity?: FieldValidity;
|
|
45
45
|
touched: boolean;
|
|
46
46
|
disabled?: boolean;
|
|
47
|
+
isOpen: boolean;
|
|
47
48
|
onClick: () => void;
|
|
48
|
-
'aria-expanded'?: boolean;
|
|
49
49
|
} ) {
|
|
50
50
|
const { labelPosition, editVisibility } =
|
|
51
51
|
field.layout as NormalizedPanelLayout;
|
|
@@ -81,11 +81,20 @@ export default function SummaryButton< Item >( {
|
|
|
81
81
|
);
|
|
82
82
|
|
|
83
83
|
const rowRef = useRef< HTMLDivElement >( null );
|
|
84
|
+
const editButtonRef = useRef< HTMLButtonElement >( null );
|
|
84
85
|
|
|
85
|
-
const handleRowClick = () => {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
const handleRowClick = ( event: React.MouseEvent ) => {
|
|
87
|
+
// Prevent a drag-to-select from opening the flyout — focus could move
|
|
88
|
+
// in and lose the selection. Skip the guard for double-clicks (standard
|
|
89
|
+
// button behavior), an already-open flyout, and the edit button.
|
|
90
|
+
if (
|
|
91
|
+
! isOpen &&
|
|
92
|
+
event.detail < 2 &&
|
|
93
|
+
! editButtonRef.current?.contains( event.target as Node ) &&
|
|
94
|
+
rowRef.current?.ownerDocument.defaultView
|
|
95
|
+
?.getSelection()
|
|
96
|
+
?.toString()
|
|
97
|
+
) {
|
|
89
98
|
return;
|
|
90
99
|
}
|
|
91
100
|
onClick();
|
|
@@ -165,11 +174,12 @@ export default function SummaryButton< Item >( {
|
|
|
165
174
|
</span>
|
|
166
175
|
{ ! disabled && (
|
|
167
176
|
<Button
|
|
177
|
+
ref={ editButtonRef }
|
|
168
178
|
className="dataforms-layouts-panel__field-trigger-icon"
|
|
169
179
|
label={ ariaLabel }
|
|
170
180
|
icon={ pencil }
|
|
171
181
|
size="small"
|
|
172
|
-
aria-expanded={
|
|
182
|
+
aria-expanded={ isOpen }
|
|
173
183
|
aria-haspopup="dialog"
|
|
174
184
|
aria-describedby={ `${ controlId }` }
|
|
175
185
|
/>
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
.dataviews-filters__search-widget-filter-combobox-list {
|
|
174
|
-
max-height:
|
|
174
|
+
max-height: 184px;
|
|
175
175
|
padding: var(--wpds-dimension-padding-xs);
|
|
176
176
|
overflow: auto;
|
|
177
177
|
border-top: 1px solid var(--wpds-color-stroke-surface-neutral);
|
|
@@ -109,8 +109,8 @@
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
.dataviews-view-activity__item-type-icon {
|
|
112
|
-
width: calc(var(--wpds-dimension-
|
|
113
|
-
height: calc(var(--wpds-dimension-
|
|
112
|
+
width: calc(var(--wpds-dimension-size-3xs) - 1px);
|
|
113
|
+
height: calc(var(--wpds-dimension-size-3xs) - 1px);
|
|
114
114
|
}
|
|
115
115
|
.dataviews-view-activity__item-content {
|
|
116
116
|
margin: var(--wpds-dimension-gap-md) 0;
|
|
@@ -126,8 +126,8 @@
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
.dataviews-view-activity__item-type-icon {
|
|
129
|
-
width: calc(var(--wpds-dimension-
|
|
130
|
-
height: calc(var(--wpds-dimension-
|
|
129
|
+
width: calc(var(--wpds-dimension-size-sm) + 1px);
|
|
130
|
+
height: calc(var(--wpds-dimension-size-sm) + 1px);
|
|
131
131
|
}
|
|
132
132
|
.dataviews-view-activity__item-content {
|
|
133
133
|
margin: var(--wpds-dimension-gap-md) 0;
|
|
@@ -144,8 +144,8 @@
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
.dataviews-view-activity__item-type-icon {
|
|
147
|
-
width: calc(var(--wpds-dimension-
|
|
148
|
-
height: calc(var(--wpds-dimension-
|
|
147
|
+
width: calc(var(--wpds-dimension-size-md) + 1px);
|
|
148
|
+
height: calc(var(--wpds-dimension-size-md) + 1px);
|
|
149
149
|
}
|
|
150
150
|
.dataviews-view-activity__item-content {
|
|
151
151
|
margin: var(--wpds-dimension-gap-sm) 0 var(--wpds-dimension-gap-lg);
|
|
@@ -156,8 +156,8 @@
|
|
|
156
156
|
&.is-comfortable,
|
|
157
157
|
&.is-balanced {
|
|
158
158
|
.dataviews-view-activity__item-bullet {
|
|
159
|
-
width: calc(var(--wpds-dimension-
|
|
160
|
-
height: calc(var(--wpds-dimension-
|
|
159
|
+
width: calc(var(--wpds-dimension-size-4xs) + 1px);
|
|
160
|
+
height: calc(var(--wpds-dimension-size-4xs) + 1px);
|
|
161
161
|
position: relative;
|
|
162
162
|
top: 50%;
|
|
163
163
|
transform: translateY(-50%);
|
|
@@ -147,7 +147,13 @@
|
|
|
147
147
|
.dataviews-view-grid__field-value:not(:empty) {
|
|
148
148
|
min-height: var(--wpds-dimension-size-sm);
|
|
149
149
|
line-height: var(--wpds-typography-line-height-sm);
|
|
150
|
-
|
|
150
|
+
// Top half of the slack between the row height and the line box,
|
|
151
|
+
// optically centering a single line within the row.
|
|
152
|
+
padding-top:
|
|
153
|
+
calc((
|
|
154
|
+
var(--wpds-dimension-size-sm) -
|
|
155
|
+
var(--wpds-typography-line-height-sm)
|
|
156
|
+
) / 2);
|
|
151
157
|
}
|
|
152
158
|
|
|
153
159
|
.dataviews-view-grid__field {
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
@use "../../../dataviews/style" as *;
|
|
2
2
|
|
|
3
|
+
// Square media (thumbnail) size per density. The compact density uses the
|
|
4
|
+
// `--wpds-dimension-size-md` token; these larger densities have no matching
|
|
5
|
+
// token, so they're kept as local constants. The field wrapper reuses the
|
|
6
|
+
// same value as its `min-height` to keep the title centered against the media.
|
|
7
|
+
// TODO: Replace with `--wpds-dimension-size-*` tokens if 48px and 64px are
|
|
8
|
+
// added to the WPDS element size scale.
|
|
9
|
+
$media-size: 48px;
|
|
10
|
+
$media-size-comfortable: 64px;
|
|
11
|
+
|
|
3
12
|
div.dataviews-view-list {
|
|
4
13
|
list-style-type: none;
|
|
5
14
|
}
|
|
@@ -135,8 +144,8 @@ div.dataviews-view-list {
|
|
|
135
144
|
}
|
|
136
145
|
|
|
137
146
|
.dataviews-view-list__media-wrapper {
|
|
138
|
-
width:
|
|
139
|
-
height:
|
|
147
|
+
width: $media-size;
|
|
148
|
+
height: $media-size;
|
|
140
149
|
overflow: hidden;
|
|
141
150
|
position: relative;
|
|
142
151
|
flex-shrink: 0;
|
|
@@ -162,7 +171,7 @@ div.dataviews-view-list {
|
|
|
162
171
|
}
|
|
163
172
|
|
|
164
173
|
.dataviews-view-list__field-wrapper {
|
|
165
|
-
min-height:
|
|
174
|
+
min-height: $media-size; // Ensures title is centrally aligned when all fields are hidden
|
|
166
175
|
flex-grow: 1;
|
|
167
176
|
min-width: 0;
|
|
168
177
|
}
|
|
@@ -245,12 +254,12 @@ div.dataviews-view-list {
|
|
|
245
254
|
}
|
|
246
255
|
|
|
247
256
|
.dataviews-view-list__media-wrapper {
|
|
248
|
-
width:
|
|
249
|
-
height:
|
|
257
|
+
width: $media-size-comfortable;
|
|
258
|
+
height: $media-size-comfortable;
|
|
250
259
|
}
|
|
251
260
|
|
|
252
261
|
.dataviews-view-list__field-wrapper {
|
|
253
|
-
min-height:
|
|
262
|
+
min-height: $media-size-comfortable;
|
|
254
263
|
}
|
|
255
264
|
|
|
256
265
|
.dataviews-view-list__fields {
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
.dataviews-view-picker-activity__item-type-icon {
|
|
47
|
-
width: calc(var(--wpds-dimension-
|
|
48
|
-
height: calc(var(--wpds-dimension-
|
|
47
|
+
width: calc(var(--wpds-dimension-size-3xs) - 1px);
|
|
48
|
+
height: calc(var(--wpds-dimension-size-3xs) - 1px);
|
|
49
49
|
}
|
|
50
50
|
.dataviews-view-picker-activity__item-content {
|
|
51
51
|
margin: var(--wpds-dimension-gap-md) 0;
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
.dataviews-view-picker-activity__item-type-icon {
|
|
64
|
-
width: calc(var(--wpds-dimension-
|
|
65
|
-
height: calc(var(--wpds-dimension-
|
|
64
|
+
width: calc(var(--wpds-dimension-size-sm) + 1px);
|
|
65
|
+
height: calc(var(--wpds-dimension-size-sm) + 1px);
|
|
66
66
|
}
|
|
67
67
|
.dataviews-view-picker-activity__item-content {
|
|
68
68
|
margin: var(--wpds-dimension-gap-md) 0;
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
.dataviews-view-picker-activity__item-type-icon {
|
|
82
|
-
width: calc(var(--wpds-dimension-
|
|
83
|
-
height: calc(var(--wpds-dimension-
|
|
82
|
+
width: calc(var(--wpds-dimension-size-md) + 1px);
|
|
83
|
+
height: calc(var(--wpds-dimension-size-md) + 1px);
|
|
84
84
|
}
|
|
85
85
|
.dataviews-view-picker-activity__item-content {
|
|
86
86
|
margin: var(--wpds-dimension-gap-sm) 0 var(--wpds-dimension-gap-lg);
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
&.is-comfortable,
|
|
92
92
|
&.is-balanced {
|
|
93
93
|
.dataviews-view-picker-activity__item-bullet {
|
|
94
|
-
width: calc(var(--wpds-dimension-
|
|
95
|
-
height: calc(var(--wpds-dimension-
|
|
94
|
+
width: calc(var(--wpds-dimension-size-4xs) + 1px);
|
|
95
|
+
height: calc(var(--wpds-dimension-size-4xs) + 1px);
|
|
96
96
|
position: relative;
|
|
97
97
|
top: 50%;
|
|
98
98
|
transform: translateY(-50%);
|
|
@@ -110,7 +110,13 @@
|
|
|
110
110
|
.dataviews-view-picker-grid__field-value:not(:empty) {
|
|
111
111
|
min-height: var(--wpds-dimension-size-sm);
|
|
112
112
|
line-height: var(--wpds-typography-line-height-sm);
|
|
113
|
-
|
|
113
|
+
// Top half of the slack between the row height and the line box,
|
|
114
|
+
// optically centering a single line within the row.
|
|
115
|
+
padding-top:
|
|
116
|
+
calc((
|
|
117
|
+
var(--wpds-dimension-size-sm) -
|
|
118
|
+
var(--wpds-typography-line-height-sm)
|
|
119
|
+
) / 2);
|
|
114
120
|
}
|
|
115
121
|
|
|
116
122
|
.dataviews-view-picker-grid__field {
|
|
@@ -178,5 +184,5 @@
|
|
|
178
184
|
font-weight: var(--wpds-typography-font-weight-medium);
|
|
179
185
|
color: var(--wpds-color-foreground-content-neutral);
|
|
180
186
|
margin: 0 0 var(--wpds-dimension-gap-sm) 0;
|
|
181
|
-
padding: 0
|
|
187
|
+
padding: 0 48px;
|
|
182
188
|
}
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
// Constrain checkbox column to fixed width while other columns share remaining space.
|
|
9
9
|
.dataviews-view-table__checkbox-column {
|
|
10
|
-
|
|
10
|
+
// TODO: Replace with a `--wpds-dimension-size-*` token if 48px is added
|
|
11
|
+
// to the WPDS element size scale.
|
|
12
|
+
width: 48px;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
tbody:focus-visible {
|
package/src/dataviews/style.scss
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
flex-grow: 1;
|
|
17
17
|
min-height: 0;
|
|
18
18
|
box-sizing: border-box;
|
|
19
|
-
scroll-padding-bottom:
|
|
19
|
+
scroll-padding-bottom: 64px;
|
|
20
20
|
/* stylelint-disable-next-line property-no-unknown -- '@container' not globally permitted */
|
|
21
21
|
container: dataviews-wrapper / inline-size;
|
|
22
22
|
display: flex;
|