@wordpress/dataviews 16.0.0 → 17.0.1-next.v.202606191442.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 +44 -1
- package/README.md +2 -2
- package/build/components/dataform-layouts/panel/summary-button.cjs.map +2 -2
- package/build/components/dataform-layouts/panel/utils/get-label-content.cjs.map +2 -2
- package/build/components/dataviews-filters/filter.cjs.map +2 -2
- package/build/components/dataviews-layouts/grid/composite-grid.cjs.map +2 -2
- package/build/components/dataviews-layouts/index.cjs +9 -0
- package/build/components/dataviews-layouts/index.cjs.map +3 -3
- package/build/components/dataviews-layouts/list/index.cjs.map +1 -1
- package/build/components/dataviews-layouts/picker-activity/index.cjs +304 -0
- package/build/components/dataviews-layouts/picker-activity/index.cjs.map +7 -0
- package/build/components/dataviews-layouts/table/column-primary.cjs +2 -2
- package/build/components/dataviews-layouts/table/column-primary.cjs.map +2 -2
- package/build/components/dataviews-pagination/index.cjs.map +1 -1
- package/build/components/dataviews-picker-footer/index.cjs +72 -33
- package/build/components/dataviews-picker-footer/index.cjs.map +2 -2
- package/build/components/dataviews-view-config/index.cjs +1 -0
- package/build/components/dataviews-view-config/index.cjs.map +2 -2
- package/build/constants.cjs +4 -1
- package/build/constants.cjs.map +2 -2
- package/build/dataviews-picker/index.cjs +2 -1
- package/build/dataviews-picker/index.cjs.map +2 -2
- package/build/field-types/password.cjs +1 -1
- package/build/field-types/password.cjs.map +2 -2
- package/build/hooks/use-form-validity.cjs +2 -2
- package/build/hooks/use-form-validity.cjs.map +2 -2
- package/build/types/dataviews.cjs.map +1 -1
- package/build-module/components/dataform-layouts/panel/summary-button.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/utils/get-label-content.mjs.map +2 -2
- package/build-module/components/dataviews-filters/filter.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/grid/composite-grid.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/index.mjs +11 -1
- package/build-module/components/dataviews-layouts/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/list/index.mjs.map +1 -1
- package/build-module/components/dataviews-layouts/picker-activity/index.mjs +273 -0
- package/build-module/components/dataviews-layouts/picker-activity/index.mjs.map +7 -0
- package/build-module/components/dataviews-layouts/table/column-primary.mjs +2 -2
- package/build-module/components/dataviews-layouts/table/column-primary.mjs.map +2 -2
- package/build-module/components/dataviews-pagination/index.mjs.map +1 -1
- package/build-module/components/dataviews-picker-footer/index.mjs +71 -33
- package/build-module/components/dataviews-picker-footer/index.mjs.map +2 -2
- package/build-module/components/dataviews-view-config/index.mjs +1 -0
- package/build-module/components/dataviews-view-config/index.mjs.map +2 -2
- package/build-module/constants.mjs +3 -1
- package/build-module/constants.mjs.map +2 -2
- package/build-module/dataviews-picker/index.mjs +6 -2
- package/build-module/dataviews-picker/index.mjs.map +2 -2
- package/build-module/field-types/password.mjs +1 -1
- package/build-module/field-types/password.mjs.map +2 -2
- package/build-module/hooks/use-form-validity.mjs +2 -2
- package/build-module/hooks/use-form-validity.mjs.map +2 -2
- package/build-style/style-rtl.css +352 -178
- package/build-style/style.css +352 -178
- package/build-types/components/dataform-layouts/panel/summary-button.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/panel/utils/get-label-content.d.ts.map +1 -1
- package/build-types/components/dataviews-filters/filter.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/grid/composite-grid.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/index.d.ts +8 -0
- package/build-types/components/dataviews-layouts/index.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/picker-activity/index.d.ts +3 -0
- package/build-types/components/dataviews-layouts/picker-activity/index.d.ts.map +1 -0
- package/build-types/components/dataviews-picker-footer/index.d.ts +3 -2
- package/build-types/components/dataviews-picker-footer/index.d.ts.map +1 -1
- package/build-types/components/dataviews-view-config/index.d.ts.map +1 -1
- package/build-types/constants.d.ts +1 -0
- package/build-types/constants.d.ts.map +1 -1
- package/build-types/dataform/stories/index.story.d.ts +1 -0
- package/build-types/dataform/stories/index.story.d.ts.map +1 -1
- package/build-types/dataviews/stories/index.story.d.ts.map +1 -1
- package/build-types/dataviews-picker/index.d.ts +3 -2
- package/build-types/dataviews-picker/index.d.ts.map +1 -1
- package/build-types/dataviews-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/types/dataviews.d.ts +16 -2
- package/build-types/types/dataviews.d.ts.map +1 -1
- package/build-wp/index.js +1267 -945
- package/package.json +31 -23
- package/src/components/dataform-controls/style.scss +1 -1
- package/src/components/dataform-layouts/card/style.scss +1 -1
- package/src/components/dataform-layouts/details/style.scss +1 -1
- package/src/components/dataform-layouts/panel/style.scss +18 -31
- package/src/components/dataform-layouts/panel/summary-button.tsx +0 -1
- package/src/components/dataform-layouts/panel/utils/get-label-content.tsx +0 -1
- package/src/components/dataform-layouts/regular/style.scss +4 -4
- package/src/components/dataviews-bulk-actions/style.scss +2 -2
- package/src/components/dataviews-filters/filter.tsx +0 -1
- package/src/components/dataviews-filters/style.scss +44 -45
- package/src/components/dataviews-layouts/activity/style.scss +11 -11
- package/src/components/dataviews-layouts/grid/composite-grid.tsx +0 -1
- package/src/components/dataviews-layouts/grid/style.scss +12 -12
- package/src/components/dataviews-layouts/index.ts +10 -0
- package/src/components/dataviews-layouts/list/style.scss +20 -21
- package/src/components/dataviews-layouts/picker-activity/index.tsx +359 -0
- package/src/components/dataviews-layouts/picker-activity/style.scss +227 -0
- package/src/components/dataviews-layouts/picker-grid/style.scss +10 -10
- package/src/components/dataviews-layouts/picker-table/style.scss +4 -4
- package/src/components/dataviews-layouts/table/style.scss +17 -17
- package/src/components/dataviews-picker-footer/index.tsx +94 -31
- package/src/components/dataviews-picker-footer/style.scss +1 -1
- package/src/components/dataviews-view-config/index.tsx +1 -0
- package/src/components/dataviews-view-config/style.scss +1 -1
- package/src/constants.ts +1 -0
- package/src/dataform/stories/content.story.tsx +1 -1
- package/src/dataform/stories/index.story.tsx +1 -0
- package/src/dataviews/stories/index.story.tsx +1 -0
- package/src/dataviews/style.scss +8 -8
- package/src/dataviews-picker/index.tsx +9 -3
- package/src/dataviews-picker/stories/index.story.tsx +6 -0
- package/src/dataviews-picker/test/dataviews-picker.tsx +5 -0
- package/src/style.scss +1 -0
- package/src/types/dataviews.ts +21 -1
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
border-color: inherit;
|
|
8
8
|
border-collapse: collapse;
|
|
9
9
|
position: relative;
|
|
10
|
-
color: var(--wpds-color-
|
|
10
|
+
color: var(--wpds-color-foreground-content-neutral-weak);
|
|
11
11
|
margin-bottom: auto;
|
|
12
12
|
background-color: inherit;
|
|
13
13
|
|
|
14
14
|
th {
|
|
15
15
|
text-align: left;
|
|
16
|
-
color: var(--wpds-color-
|
|
16
|
+
color: var(--wpds-color-foreground-content-neutral);
|
|
17
17
|
font-weight: normal;
|
|
18
18
|
font-size: var(--wpds-typography-font-size-md);
|
|
19
19
|
}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
&.dataviews-view-table__actions-column--sticky {
|
|
29
29
|
position: sticky;
|
|
30
30
|
right: 0;
|
|
31
|
-
background-color: var(--wp-dataviews-color-background, var(--wpds-color-
|
|
31
|
+
background-color: var(--wp-dataviews-color-background, var(--wpds-color-background-surface-neutral-strong));
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
&.dataviews-view-table__actions-column--stuck {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
bottom: 0;
|
|
41
41
|
left: 0;
|
|
42
42
|
width: 1px;
|
|
43
|
-
background-color: var(--wpds-color-
|
|
43
|
+
background-color: var(--wpds-color-background-surface-neutral);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
&.is-selected {
|
|
86
|
-
background-color: var(--wpds-color-
|
|
87
|
-
color: var(--wpds-color-
|
|
86
|
+
background-color: var(--wpds-color-background-interactive-brand-weak-active);
|
|
87
|
+
color: var(--wpds-color-foreground-content-neutral);
|
|
88
88
|
|
|
89
89
|
&,
|
|
90
90
|
& + tr {
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
.dataviews-view-table__actions-column--sticky {
|
|
95
|
-
background-color: var(--wpds-color-
|
|
95
|
+
background-color: var(--wpds-color-background-interactive-brand-weak-active);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
@@ -112,14 +112,14 @@
|
|
|
112
112
|
&:focus-within,
|
|
113
113
|
&:hover {
|
|
114
114
|
.dataviews-view-table__actions-column--sticky {
|
|
115
|
-
background-color: var(--wp-dataviews-color-background, var(--wpds-color-
|
|
115
|
+
background-color: var(--wp-dataviews-color-background, var(--wpds-color-background-surface-neutral-strong));
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
&.is-selected,
|
|
120
120
|
&.is-selected:hover {
|
|
121
121
|
.dataviews-view-table__actions-column--sticky {
|
|
122
|
-
background-color: var(--wpds-color-
|
|
122
|
+
background-color: var(--wpds-color-background-interactive-brand-weak-active);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
}
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
vertical-align: top;
|
|
182
182
|
}
|
|
183
183
|
.dataviews-view-table__cell-content-wrapper {
|
|
184
|
-
min-height:
|
|
184
|
+
min-height: var(--wpds-dimension-size-md);
|
|
185
185
|
display: flex;
|
|
186
186
|
align-items: center;
|
|
187
187
|
white-space: nowrap;
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
font-weight: var(--wpds-typography-font-weight-medium);
|
|
208
208
|
|
|
209
209
|
&:not(:hover) {
|
|
210
|
-
color: var(--wpds-color-
|
|
210
|
+
color: var(--wpds-color-foreground-interactive-neutral);
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
span {
|
|
@@ -276,17 +276,17 @@
|
|
|
276
276
|
|
|
277
277
|
.dataviews-column-primary__media {
|
|
278
278
|
max-width: 60px;
|
|
279
|
-
min-width:
|
|
280
|
-
min-height:
|
|
279
|
+
min-width: var(--wpds-dimension-size-md);
|
|
280
|
+
min-height: var(--wpds-dimension-size-md);
|
|
281
281
|
overflow: hidden;
|
|
282
282
|
position: relative;
|
|
283
283
|
flex-shrink: 0;
|
|
284
|
-
background-color: var(--wpds-color-
|
|
284
|
+
background-color: var(--wpds-color-background-surface-neutral-strong);
|
|
285
285
|
border-radius: var(--wpds-border-radius-md);
|
|
286
286
|
|
|
287
287
|
img {
|
|
288
|
-
width:
|
|
289
|
-
height:
|
|
288
|
+
width: var(--wpds-dimension-size-md);
|
|
289
|
+
height: var(--wpds-dimension-size-md);
|
|
290
290
|
object-fit: cover;
|
|
291
291
|
}
|
|
292
292
|
|
|
@@ -314,7 +314,7 @@
|
|
|
314
314
|
.dataviews-view-table__group-header-cell {
|
|
315
315
|
font-weight: var(--wpds-typography-font-weight-medium);
|
|
316
316
|
padding: var(--wpds-dimension-padding-md) var(--wpds-dimension-padding-2xl);
|
|
317
|
-
color: var(--wpds-color-
|
|
317
|
+
color: var(--wpds-color-foreground-content-neutral);
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
|
|
@@ -22,7 +22,10 @@ export function useIsMultiselectPicker< Item >(
|
|
|
22
22
|
actions: Action< Item >[] | undefined
|
|
23
23
|
) {
|
|
24
24
|
return useMemo( () => {
|
|
25
|
-
return
|
|
25
|
+
return (
|
|
26
|
+
!! actions?.length &&
|
|
27
|
+
actions?.every( ( action ) => action.supportsBulk )
|
|
28
|
+
);
|
|
26
29
|
}, [ actions ] );
|
|
27
30
|
}
|
|
28
31
|
|
|
@@ -145,7 +148,7 @@ function ActionButtons< Item >( {
|
|
|
145
148
|
);
|
|
146
149
|
}
|
|
147
150
|
|
|
148
|
-
|
|
151
|
+
function PickerBulkSelectionInfo() {
|
|
149
152
|
const {
|
|
150
153
|
data,
|
|
151
154
|
selection,
|
|
@@ -158,6 +161,17 @@ export function DataViewsPickerFooter() {
|
|
|
158
161
|
|
|
159
162
|
const isMultiselect = useIsMultiselectPicker( actions );
|
|
160
163
|
|
|
164
|
+
const selectedItems = useMemo(
|
|
165
|
+
() =>
|
|
166
|
+
data.filter( ( item ) => selection.includes( getItemId( item ) ) ),
|
|
167
|
+
[ selection, getItemId, data ]
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
// The count and the selection checkbox belong with the actions, mirroring `DataViews`.
|
|
171
|
+
if ( ! actions.length ) {
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
|
|
161
175
|
const message = getFooterMessage(
|
|
162
176
|
selection.length,
|
|
163
177
|
data.length,
|
|
@@ -165,12 +179,88 @@ export function DataViewsPickerFooter() {
|
|
|
165
179
|
!! view.infiniteScrollEnabled
|
|
166
180
|
);
|
|
167
181
|
|
|
182
|
+
return (
|
|
183
|
+
<Stack
|
|
184
|
+
direction="row"
|
|
185
|
+
className="dataviews-picker-footer__bulk-selection"
|
|
186
|
+
gap="md"
|
|
187
|
+
align="center"
|
|
188
|
+
>
|
|
189
|
+
{ isMultiselect && (
|
|
190
|
+
<BulkSelectionCheckbox
|
|
191
|
+
selection={ selection }
|
|
192
|
+
selectedItems={ selectedItems }
|
|
193
|
+
onChangeSelection={ onChangeSelection }
|
|
194
|
+
data={ data }
|
|
195
|
+
getItemId={ getItemId }
|
|
196
|
+
disableSelectAll={ !! view.infiniteScrollEnabled }
|
|
197
|
+
/>
|
|
198
|
+
) }
|
|
199
|
+
<span className="dataviews-bulk-actions-footer__item-count">
|
|
200
|
+
{ message }
|
|
201
|
+
</span>
|
|
202
|
+
</Stack>
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function PickerActions() {
|
|
207
|
+
const {
|
|
208
|
+
data,
|
|
209
|
+
selection,
|
|
210
|
+
getItemId,
|
|
211
|
+
actions = EMPTY_ARRAY,
|
|
212
|
+
} = useContext( DataViewsContext );
|
|
213
|
+
|
|
168
214
|
const selectedItems = useMemo(
|
|
169
215
|
() =>
|
|
170
216
|
data.filter( ( item ) => selection.includes( getItemId( item ) ) ),
|
|
171
217
|
[ selection, getItemId, data ]
|
|
172
218
|
);
|
|
173
219
|
|
|
220
|
+
if ( ! actions.length ) {
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return (
|
|
225
|
+
<div className="dataviews-picker-footer__actions">
|
|
226
|
+
<ActionButtons
|
|
227
|
+
actions={ actions }
|
|
228
|
+
items={ selectedItems }
|
|
229
|
+
selection={ selection }
|
|
230
|
+
/>
|
|
231
|
+
</div>
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// The bulk-selection info and action buttons without pagination — the picker
|
|
236
|
+
// counterpart to `DataViews.BulkActionToolbar`, for free composition.
|
|
237
|
+
export function DataViewsPickerBulkActionToolbar() {
|
|
238
|
+
return (
|
|
239
|
+
<Stack direction="row" gap="md" align="center">
|
|
240
|
+
<PickerBulkSelectionInfo />
|
|
241
|
+
<PickerActions />
|
|
242
|
+
</Stack>
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// The full picker footer: bulk-selection info, pagination, and actions — the
|
|
247
|
+
// picker counterpart to `DataViews.Footer`.
|
|
248
|
+
export function DataViewsPickerFooter() {
|
|
249
|
+
const {
|
|
250
|
+
actions = EMPTY_ARRAY,
|
|
251
|
+
paginationInfo,
|
|
252
|
+
view,
|
|
253
|
+
} = useContext( DataViewsContext );
|
|
254
|
+
|
|
255
|
+
const hasPagination =
|
|
256
|
+
! view.infiniteScrollEnabled &&
|
|
257
|
+
!! paginationInfo.totalItems &&
|
|
258
|
+
paginationInfo.totalPages > 1;
|
|
259
|
+
|
|
260
|
+
if ( ! actions.length && ! hasPagination ) {
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
|
|
174
264
|
return (
|
|
175
265
|
<Stack
|
|
176
266
|
direction="row"
|
|
@@ -179,36 +269,9 @@ export function DataViewsPickerFooter() {
|
|
|
179
269
|
className="dataviews-footer"
|
|
180
270
|
gap="sm"
|
|
181
271
|
>
|
|
182
|
-
<
|
|
183
|
-
direction="row"
|
|
184
|
-
className="dataviews-picker-footer__bulk-selection"
|
|
185
|
-
gap="md"
|
|
186
|
-
align="center"
|
|
187
|
-
>
|
|
188
|
-
{ isMultiselect && (
|
|
189
|
-
<BulkSelectionCheckbox
|
|
190
|
-
selection={ selection }
|
|
191
|
-
selectedItems={ selectedItems }
|
|
192
|
-
onChangeSelection={ onChangeSelection }
|
|
193
|
-
data={ data }
|
|
194
|
-
getItemId={ getItemId }
|
|
195
|
-
disableSelectAll={ !! view.infiniteScrollEnabled }
|
|
196
|
-
/>
|
|
197
|
-
) }
|
|
198
|
-
<span className="dataviews-bulk-actions-footer__item-count">
|
|
199
|
-
{ message }
|
|
200
|
-
</span>
|
|
201
|
-
</Stack>
|
|
272
|
+
<PickerBulkSelectionInfo />
|
|
202
273
|
<DataViewsPagination />
|
|
203
|
-
|
|
204
|
-
<div className="dataviews-picker-footer__actions">
|
|
205
|
-
<ActionButtons
|
|
206
|
-
actions={ actions }
|
|
207
|
-
items={ selectedItems }
|
|
208
|
-
selection={ selection }
|
|
209
|
-
/>
|
|
210
|
-
</div>
|
|
211
|
-
) }
|
|
274
|
+
<PickerActions />
|
|
212
275
|
</Stack>
|
|
213
276
|
);
|
|
214
277
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// - align footer actions to the right.
|
|
4
4
|
.dataviews-picker-footer__bulk-selection {
|
|
5
5
|
align-self: flex-start;
|
|
6
|
-
height:
|
|
6
|
+
height: var(--wpds-dimension-size-md);
|
|
7
7
|
}
|
|
8
8
|
.dataviews-picker-footer__actions {
|
|
9
9
|
align-self: flex-end;
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
right: var(--wpds-dimension-gap-xs);
|
|
76
76
|
width: var(--wpds-dimension-gap-xs);
|
|
77
77
|
height: var(--wpds-dimension-gap-xs);
|
|
78
|
-
background: var(--wpds-color-
|
|
78
|
+
background: var(--wpds-color-background-interactive-brand-strong);
|
|
79
79
|
border-radius: 50%;
|
|
80
80
|
pointer-events: none;
|
|
81
81
|
}
|
package/src/constants.ts
CHANGED
|
@@ -54,5 +54,6 @@ export const LAYOUT_ACTIVITY = 'activity';
|
|
|
54
54
|
// Picker view layouts.
|
|
55
55
|
export const LAYOUT_PICKER_GRID = 'pickerGrid';
|
|
56
56
|
export const LAYOUT_PICKER_TABLE = 'pickerTable';
|
|
57
|
+
export const LAYOUT_PICKER_ACTIVITY = 'pickerActivity';
|
|
57
58
|
|
|
58
59
|
export const DAYS_OF_WEEK: DayNumber[] = [ 0, 1, 2, 3, 4, 5, 6 ];
|
|
@@ -18,7 +18,7 @@ const meta: Meta< typeof DataForm > = {
|
|
|
18
18
|
parameters: {
|
|
19
19
|
controls: { disable: true },
|
|
20
20
|
},
|
|
21
|
-
tags: [ '!dev' /* Hide individual story pages from sidebar
|
|
21
|
+
tags: [ '!dev' /* Hide individual story pages from sidebar */, 'manifest' ],
|
|
22
22
|
};
|
|
23
23
|
export default meta;
|
|
24
24
|
|
package/src/dataviews/style.scss
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
flex-direction: column;
|
|
24
24
|
font-size: var(--wpds-typography-font-size-md);
|
|
25
25
|
line-height: var(--wpds-typography-line-height-sm);
|
|
26
|
-
background-color: var(--wp-dataviews-color-background, var(--wpds-color-
|
|
26
|
+
background-color: var(--wp-dataviews-color-background, var(--wpds-color-background-surface-neutral-strong));
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.dataviews__view-actions,
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
.dataviews-title-field {
|
|
83
83
|
font-size: var(--wpds-typography-font-size-md);
|
|
84
84
|
font-weight: var(--wpds-typography-font-weight-medium);
|
|
85
|
-
color: var(--wpds-color-
|
|
85
|
+
color: var(--wpds-color-foreground-content-neutral);
|
|
86
86
|
text-overflow: ellipsis;
|
|
87
87
|
white-space: nowrap;
|
|
88
88
|
width: 100%;
|
|
@@ -94,10 +94,10 @@
|
|
|
94
94
|
overflow: hidden;
|
|
95
95
|
display: block;
|
|
96
96
|
flex-grow: 0;
|
|
97
|
-
color: var(--wpds-color-
|
|
97
|
+
color: var(--wpds-color-foreground-interactive-neutral);
|
|
98
98
|
|
|
99
99
|
&:hover {
|
|
100
|
-
color: var(--wpds-color-
|
|
100
|
+
color: var(--wpds-color-foreground-interactive-brand);
|
|
101
101
|
}
|
|
102
102
|
@include link-reset();
|
|
103
103
|
}
|
|
@@ -110,18 +110,18 @@
|
|
|
110
110
|
overflow: hidden;
|
|
111
111
|
display: block;
|
|
112
112
|
width: 100%;
|
|
113
|
-
color: var(--wpds-color-
|
|
113
|
+
color: var(--wpds-color-foreground-interactive-neutral-active);
|
|
114
114
|
&:hover {
|
|
115
|
-
color: var(--wpds-color-
|
|
115
|
+
color: var(--wpds-color-foreground-interactive-brand);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
.dataviews-title-field--clickable {
|
|
121
121
|
cursor: var(--wpds-cursor-control);
|
|
122
|
-
color: var(--wpds-color-
|
|
122
|
+
color: var(--wpds-color-foreground-interactive-neutral);
|
|
123
123
|
&:hover {
|
|
124
|
-
color: var(--wpds-color-
|
|
124
|
+
color: var(--wpds-color-foreground-interactive-brand);
|
|
125
125
|
}
|
|
126
126
|
@include link-reset();
|
|
127
127
|
}
|
|
@@ -29,7 +29,10 @@ import {
|
|
|
29
29
|
FiltersToggle,
|
|
30
30
|
} from '../components/dataviews-filters';
|
|
31
31
|
import DataViewsLayout from '../components/dataviews-layout';
|
|
32
|
-
import {
|
|
32
|
+
import {
|
|
33
|
+
DataViewsPickerFooter,
|
|
34
|
+
DataViewsPickerBulkActionToolbar,
|
|
35
|
+
} from '../components/dataviews-picker-footer';
|
|
33
36
|
import DataViewsSearch from '../components/dataviews-search';
|
|
34
37
|
import { DataViewsPagination } from '../components/dataviews-pagination';
|
|
35
38
|
import DataViewsViewConfig, {
|
|
@@ -269,7 +272,8 @@ function DataViewsPicker< Item >( {
|
|
|
269
272
|
// Populate the DataViews sub components
|
|
270
273
|
const DataViewsPickerSubComponents =
|
|
271
274
|
DataViewsPicker as typeof DataViewsPicker & {
|
|
272
|
-
BulkActionToolbar: typeof
|
|
275
|
+
BulkActionToolbar: typeof DataViewsPickerBulkActionToolbar;
|
|
276
|
+
Footer: typeof DataViewsPickerFooter;
|
|
273
277
|
Filters: typeof Filters;
|
|
274
278
|
FiltersToggled: typeof FiltersToggled;
|
|
275
279
|
FiltersToggle: typeof FiltersToggle;
|
|
@@ -280,7 +284,9 @@ const DataViewsPickerSubComponents =
|
|
|
280
284
|
ViewConfig: typeof DataviewsViewConfigDropdown;
|
|
281
285
|
};
|
|
282
286
|
|
|
283
|
-
DataViewsPickerSubComponents.BulkActionToolbar =
|
|
287
|
+
DataViewsPickerSubComponents.BulkActionToolbar =
|
|
288
|
+
DataViewsPickerBulkActionToolbar;
|
|
289
|
+
DataViewsPickerSubComponents.Footer = DataViewsPickerFooter;
|
|
284
290
|
DataViewsPickerSubComponents.Filters = Filters;
|
|
285
291
|
DataViewsPickerSubComponents.FiltersToggled = FiltersToggled;
|
|
286
292
|
DataViewsPickerSubComponents.FiltersToggle = FiltersToggle;
|
|
@@ -20,6 +20,7 @@ import type { ActionButton, View } from '../../types';
|
|
|
20
20
|
import { data, fields, type SpaceObject } from './fixtures';
|
|
21
21
|
|
|
22
22
|
const meta = {
|
|
23
|
+
tags: [ 'manifest' ],
|
|
23
24
|
title: 'DataViews/DataViewsPicker',
|
|
24
25
|
component: DataViewsPicker,
|
|
25
26
|
} as Meta< typeof DataViewsPicker >;
|
|
@@ -186,6 +187,11 @@ const DataViewsPickerContent = ( {
|
|
|
186
187
|
fields={ fields }
|
|
187
188
|
onChangeView={ setView }
|
|
188
189
|
config={ { perPageSizes } }
|
|
190
|
+
defaultLayouts={ {
|
|
191
|
+
pickerGrid: true,
|
|
192
|
+
pickerTable: true,
|
|
193
|
+
pickerActivity: true,
|
|
194
|
+
} }
|
|
189
195
|
itemListLabel="Galactic Bodies"
|
|
190
196
|
/>
|
|
191
197
|
</>
|
|
@@ -543,6 +543,11 @@ describe( 'DataViews Picker', () => {
|
|
|
543
543
|
screen.getByRole( 'menuitemradio', { name: 'Table' } )
|
|
544
544
|
).toBeInTheDocument();
|
|
545
545
|
|
|
546
|
+
// The Activity layout is opt-in and must not appear by default.
|
|
547
|
+
expect(
|
|
548
|
+
screen.queryByRole( 'menuitemradio', { name: 'Activity' } )
|
|
549
|
+
).not.toBeInTheDocument();
|
|
550
|
+
|
|
546
551
|
// The grid layout is active by default.
|
|
547
552
|
expect(
|
|
548
553
|
screen.getByRole( 'menuitemradio', { name: 'Grid' } )
|
package/src/style.scss
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
@use "./components/dataviews-layouts/picker-grid/style.scss" as *;
|
|
14
14
|
@use "./components/dataviews-layouts/picker-table/style.scss" as *;
|
|
15
15
|
@use "./components/dataviews-layouts/activity/style.scss" as *;
|
|
16
|
+
@use "./components/dataviews-layouts/picker-activity/style.scss" as *;
|
|
16
17
|
@use "./components/dataviews-picker-footer/style.scss" as *;
|
|
17
18
|
|
|
18
19
|
@use "./components/dataform-controls/style.scss" as *;
|
package/src/types/dataviews.ts
CHANGED
|
@@ -342,12 +342,24 @@ export interface ViewPickerTable extends ViewBase {
|
|
|
342
342
|
};
|
|
343
343
|
}
|
|
344
344
|
|
|
345
|
+
export interface ViewPickerActivity extends ViewBase {
|
|
346
|
+
type: 'pickerActivity';
|
|
347
|
+
|
|
348
|
+
layout?: {
|
|
349
|
+
/**
|
|
350
|
+
* The density of the view.
|
|
351
|
+
*/
|
|
352
|
+
density?: Density;
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
|
|
345
356
|
export type View =
|
|
346
357
|
| ViewList
|
|
347
358
|
| ViewGrid
|
|
348
359
|
| ViewTable
|
|
349
360
|
| ViewPickerGrid
|
|
350
361
|
| ViewPickerTable
|
|
362
|
+
| ViewPickerActivity
|
|
351
363
|
| ViewActivity;
|
|
352
364
|
|
|
353
365
|
interface ActionBase< Item > {
|
|
@@ -516,6 +528,11 @@ export interface ViewPickerTableProps< Item >
|
|
|
516
528
|
view: ViewPickerTable;
|
|
517
529
|
}
|
|
518
530
|
|
|
531
|
+
export interface ViewPickerActivityProps< Item >
|
|
532
|
+
extends Omit< ViewPickerBaseProps< Item >, 'view' > {
|
|
533
|
+
view: ViewPickerActivity;
|
|
534
|
+
}
|
|
535
|
+
|
|
519
536
|
export type ViewProps< Item > =
|
|
520
537
|
| ViewTableProps< Item >
|
|
521
538
|
| ViewGridProps< Item >
|
|
@@ -524,7 +541,8 @@ export type ViewProps< Item > =
|
|
|
524
541
|
|
|
525
542
|
export type ViewPickerProps< Item > =
|
|
526
543
|
| ViewPickerGridProps< Item >
|
|
527
|
-
| ViewPickerTableProps< Item
|
|
544
|
+
| ViewPickerTableProps< Item >
|
|
545
|
+
| ViewPickerActivityProps< Item >;
|
|
528
546
|
|
|
529
547
|
export interface SupportedLayouts {
|
|
530
548
|
list?: Omit< ViewList, 'type' > | true;
|
|
@@ -533,6 +551,7 @@ export interface SupportedLayouts {
|
|
|
533
551
|
activity?: Omit< ViewActivity, 'type' > | true;
|
|
534
552
|
pickerGrid?: Omit< ViewPickerGrid, 'type' > | true;
|
|
535
553
|
pickerTable?: Omit< ViewPickerTable, 'type' > | true;
|
|
554
|
+
pickerActivity?: Omit< ViewPickerActivity, 'type' > | true;
|
|
536
555
|
}
|
|
537
556
|
|
|
538
557
|
export interface NormalizedSupportedLayouts {
|
|
@@ -542,4 +561,5 @@ export interface NormalizedSupportedLayouts {
|
|
|
542
561
|
activity?: Omit< ViewActivity, 'type' >;
|
|
543
562
|
pickerGrid?: Omit< ViewPickerGrid, 'type' >;
|
|
544
563
|
pickerTable?: Omit< ViewPickerTable, 'type' >;
|
|
564
|
+
pickerActivity?: Omit< ViewPickerActivity, 'type' >;
|
|
545
565
|
}
|