@wordpress/dataviews 1.1.0 → 1.2.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 +11 -5
- package/build/bulk-actions-toolbar.js +182 -0
- package/build/bulk-actions-toolbar.js.map +1 -0
- package/build/bulk-actions.js +8 -8
- package/build/bulk-actions.js.map +1 -1
- package/build/dataviews.js +11 -4
- package/build/dataviews.js.map +1 -1
- package/build/filter-and-sort-data-view.js +2 -2
- package/build/filter-and-sort-data-view.js.map +1 -1
- package/build/filter-summary.js +3 -3
- package/build/filter-summary.js.map +1 -1
- package/build/item-actions.js +41 -22
- package/build/item-actions.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/normalize-fields.js.map +1 -1
- package/build/pagination.js +13 -7
- package/build/pagination.js.map +1 -1
- package/build/single-selection-checkbox.js +4 -0
- package/build/single-selection-checkbox.js.map +1 -1
- package/build/types.js.map +1 -1
- package/build/view-grid.js +9 -10
- package/build/view-grid.js.map +1 -1
- package/build/view-list.js +134 -21
- package/build/view-list.js.map +1 -1
- package/build/view-table.js +9 -9
- package/build/view-table.js.map +1 -1
- package/build-module/bulk-actions-toolbar.js +175 -0
- package/build-module/bulk-actions-toolbar.js.map +1 -0
- package/build-module/bulk-actions.js +8 -8
- package/build-module/bulk-actions.js.map +1 -1
- package/build-module/dataviews.js +11 -4
- package/build-module/dataviews.js.map +1 -1
- package/build-module/filter-and-sort-data-view.js +2 -2
- package/build-module/filter-and-sort-data-view.js.map +1 -1
- package/build-module/filter-summary.js +3 -3
- package/build-module/filter-summary.js.map +1 -1
- package/build-module/item-actions.js +40 -24
- package/build-module/item-actions.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/normalize-fields.js.map +1 -1
- package/build-module/pagination.js +14 -7
- package/build-module/pagination.js.map +1 -1
- package/build-module/single-selection-checkbox.js +5 -0
- package/build-module/single-selection-checkbox.js.map +1 -1
- package/build-module/types.js.map +1 -1
- package/build-module/view-grid.js +9 -10
- package/build-module/view-grid.js.map +1 -1
- package/build-module/view-list.js +135 -23
- package/build-module/view-list.js.map +1 -1
- package/build-module/view-table.js +9 -9
- package/build-module/view-table.js.map +1 -1
- package/build-style/style-rtl.css +62 -27
- package/build-style/style.css +62 -27
- package/build-types/add-filter.d.ts +8 -0
- package/build-types/add-filter.d.ts.map +1 -0
- package/build-types/bulk-actions-toolbar.d.ts +8 -0
- package/build-types/bulk-actions-toolbar.d.ts.map +1 -0
- package/build-types/bulk-actions.d.ts +14 -0
- package/build-types/bulk-actions.d.ts.map +1 -0
- package/build-types/dataviews.d.ts +15 -0
- package/build-types/dataviews.d.ts.map +1 -0
- package/build-types/dropdown-menu-helper.d.ts +6 -0
- package/build-types/dropdown-menu-helper.d.ts.map +1 -0
- package/build-types/filter-and-sort-data-view.d.ts +3 -3
- package/build-types/filter-and-sort-data-view.d.ts.map +1 -1
- package/build-types/filter-summary.d.ts +6 -0
- package/build-types/filter-summary.d.ts.map +1 -0
- package/build-types/filters.d.ts +3 -0
- package/build-types/filters.d.ts.map +1 -0
- package/build-types/index.d.ts +4 -0
- package/build-types/index.d.ts.map +1 -0
- package/build-types/item-actions.d.ts +37 -0
- package/build-types/item-actions.d.ts.map +1 -0
- package/build-types/layouts.d.ts +20 -0
- package/build-types/layouts.d.ts.map +1 -0
- package/build-types/lock-unlock.d.ts +2 -0
- package/build-types/lock-unlock.d.ts.map +1 -0
- package/build-types/normalize-fields.d.ts +2 -2
- package/build-types/normalize-fields.d.ts.map +1 -1
- package/build-types/pagination.d.ts +16 -0
- package/build-types/pagination.d.ts.map +1 -0
- package/build-types/reset-filters.d.ts +6 -0
- package/build-types/reset-filters.d.ts.map +1 -0
- package/build-types/search-widget.d.ts +2 -0
- package/build-types/search-widget.d.ts.map +1 -0
- package/build-types/search.d.ts +3 -0
- package/build-types/search.d.ts.map +1 -0
- package/build-types/single-selection-checkbox.d.ts +17 -0
- package/build-types/single-selection-checkbox.d.ts.map +1 -0
- package/build-types/stories/fixtures.d.ts +114 -0
- package/build-types/stories/fixtures.d.ts.map +1 -0
- package/build-types/stories/index.story.d.ts +15 -0
- package/build-types/stories/index.story.d.ts.map +1 -0
- package/build-types/types.d.ts +152 -20
- package/build-types/types.d.ts.map +1 -1
- package/build-types/utils.d.ts +2 -0
- package/build-types/utils.d.ts.map +1 -0
- package/build-types/view-actions.d.ts +3 -0
- package/build-types/view-actions.d.ts.map +1 -0
- package/build-types/view-grid.d.ts +15 -0
- package/build-types/view-grid.d.ts.map +1 -0
- package/build-types/view-list.d.ts +16 -0
- package/build-types/view-list.d.ts.map +1 -0
- package/build-types/view-table.d.ts +14 -0
- package/build-types/view-table.d.ts.map +1 -0
- package/package.json +12 -12
- package/src/bulk-actions-toolbar.js +244 -0
- package/src/{bulk-actions.js → bulk-actions.tsx} +73 -17
- package/src/dataviews.js +14 -3
- package/src/filter-and-sort-data-view.ts +13 -8
- package/src/filter-summary.js +3 -3
- package/src/{item-actions.js → item-actions.tsx} +112 -28
- package/src/normalize-fields.ts +4 -2
- package/src/{pagination.js → pagination.tsx} +28 -7
- package/src/{single-selection-checkbox.js → single-selection-checkbox.tsx} +17 -2
- package/src/style.scss +77 -28
- package/src/types.ts +190 -20
- package/src/{view-grid.js → view-grid.tsx} +45 -16
- package/src/view-list.tsx +421 -0
- package/src/view-table.js +8 -8
- package/tsconfig.json +4 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/src/view-list.js +0 -207
- /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export const data: {
|
|
2
|
+
id: number;
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
image: string;
|
|
6
|
+
type: string;
|
|
7
|
+
categories: string[];
|
|
8
|
+
}[];
|
|
9
|
+
export namespace DEFAULT_VIEW {
|
|
10
|
+
export { LAYOUT_TABLE as type };
|
|
11
|
+
export let search: string;
|
|
12
|
+
export let page: number;
|
|
13
|
+
export let perPage: number;
|
|
14
|
+
export let hiddenFields: string[];
|
|
15
|
+
export let layout: {};
|
|
16
|
+
export let filters: never[];
|
|
17
|
+
}
|
|
18
|
+
export const actions: ({
|
|
19
|
+
id: string;
|
|
20
|
+
label: string;
|
|
21
|
+
isPrimary: boolean;
|
|
22
|
+
icon: import("react").JSX.Element;
|
|
23
|
+
hideModalHeader: boolean;
|
|
24
|
+
RenderModal: ({ item, closeModal }: {
|
|
25
|
+
item: any;
|
|
26
|
+
closeModal: any;
|
|
27
|
+
}) => import("react").JSX.Element;
|
|
28
|
+
callback?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
id: string;
|
|
31
|
+
label: string;
|
|
32
|
+
callback(): void;
|
|
33
|
+
isPrimary?: undefined;
|
|
34
|
+
icon?: undefined;
|
|
35
|
+
hideModalHeader?: undefined;
|
|
36
|
+
RenderModal?: undefined;
|
|
37
|
+
})[];
|
|
38
|
+
export const fields: ({
|
|
39
|
+
header: string;
|
|
40
|
+
id: string;
|
|
41
|
+
render: ({ item }: {
|
|
42
|
+
item: any;
|
|
43
|
+
}) => import("react").JSX.Element;
|
|
44
|
+
width: number;
|
|
45
|
+
enableSorting: boolean;
|
|
46
|
+
maxWidth?: undefined;
|
|
47
|
+
enableHiding?: undefined;
|
|
48
|
+
enableGlobalSearch?: undefined;
|
|
49
|
+
elements?: undefined;
|
|
50
|
+
filterBy?: undefined;
|
|
51
|
+
getValue?: undefined;
|
|
52
|
+
} | {
|
|
53
|
+
header: string;
|
|
54
|
+
id: string;
|
|
55
|
+
maxWidth: number;
|
|
56
|
+
enableHiding: boolean;
|
|
57
|
+
enableGlobalSearch: boolean;
|
|
58
|
+
render?: undefined;
|
|
59
|
+
width?: undefined;
|
|
60
|
+
enableSorting?: undefined;
|
|
61
|
+
elements?: undefined;
|
|
62
|
+
filterBy?: undefined;
|
|
63
|
+
getValue?: undefined;
|
|
64
|
+
} | {
|
|
65
|
+
header: string;
|
|
66
|
+
id: string;
|
|
67
|
+
maxWidth: number;
|
|
68
|
+
enableHiding: boolean;
|
|
69
|
+
elements: {
|
|
70
|
+
value: string;
|
|
71
|
+
label: string;
|
|
72
|
+
}[];
|
|
73
|
+
render?: undefined;
|
|
74
|
+
width?: undefined;
|
|
75
|
+
enableSorting?: undefined;
|
|
76
|
+
enableGlobalSearch?: undefined;
|
|
77
|
+
filterBy?: undefined;
|
|
78
|
+
getValue?: undefined;
|
|
79
|
+
} | {
|
|
80
|
+
header: string;
|
|
81
|
+
id: string;
|
|
82
|
+
maxWidth: number;
|
|
83
|
+
enableSorting: boolean;
|
|
84
|
+
enableGlobalSearch: boolean;
|
|
85
|
+
render?: undefined;
|
|
86
|
+
width?: undefined;
|
|
87
|
+
enableHiding?: undefined;
|
|
88
|
+
elements?: undefined;
|
|
89
|
+
filterBy?: undefined;
|
|
90
|
+
getValue?: undefined;
|
|
91
|
+
} | {
|
|
92
|
+
header: string;
|
|
93
|
+
id: string;
|
|
94
|
+
elements: {
|
|
95
|
+
value: string;
|
|
96
|
+
label: string;
|
|
97
|
+
}[];
|
|
98
|
+
filterBy: {
|
|
99
|
+
operators: string[];
|
|
100
|
+
};
|
|
101
|
+
getValue: ({ item }: {
|
|
102
|
+
item: any;
|
|
103
|
+
}) => any;
|
|
104
|
+
render: ({ item }: {
|
|
105
|
+
item: any;
|
|
106
|
+
}) => any;
|
|
107
|
+
enableSorting: boolean;
|
|
108
|
+
width?: undefined;
|
|
109
|
+
maxWidth?: undefined;
|
|
110
|
+
enableHiding?: undefined;
|
|
111
|
+
enableGlobalSearch?: undefined;
|
|
112
|
+
})[];
|
|
113
|
+
import { LAYOUT_TABLE } from '../constants';
|
|
114
|
+
//# sourceMappingURL=fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/stories/fixtures.js"],"names":[],"mappings":"AAgBA;;;;;;;IAyFE;;;;;;;;;;AAYF;;;;;;;;;;;;;;;;;;;KA8BE;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2DE;6BAlM2B,cAAc"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default meta;
|
|
2
|
+
export function Default(props: any): import("react").JSX.Element;
|
|
3
|
+
export namespace Default {
|
|
4
|
+
namespace args {
|
|
5
|
+
export { actions };
|
|
6
|
+
export let supportedLayouts: string[];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
declare namespace meta {
|
|
10
|
+
export let title: string;
|
|
11
|
+
export { DataViews as component };
|
|
12
|
+
}
|
|
13
|
+
import { actions } from './fixtures';
|
|
14
|
+
import { DataViews } from '../index';
|
|
15
|
+
//# sourceMappingURL=index.story.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../src/stories/index.story.js"],"names":[],"mappings":";AA6BO,iEA8BN;;;;;;;;;;;wBAlDmD,YAAY;0BADtC,UAAU"}
|
package/build-types/types.d.ts
CHANGED
|
@@ -1,18 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type { ReactNode } from 'react';
|
|
5
|
-
type
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
5
|
+
export type SortDirection = 'asc' | 'desc';
|
|
6
|
+
/**
|
|
7
|
+
* Generic option type.
|
|
8
|
+
*/
|
|
9
|
+
interface Option<Value extends any = any> {
|
|
10
|
+
value: Value;
|
|
8
11
|
label: string;
|
|
9
12
|
}
|
|
10
|
-
interface
|
|
13
|
+
interface FilterByConfig {
|
|
14
|
+
/**
|
|
15
|
+
* The list of operators supported by the field.
|
|
16
|
+
*/
|
|
11
17
|
operators?: Operator[];
|
|
18
|
+
/**
|
|
19
|
+
* Whether it is a primary filter.
|
|
20
|
+
*
|
|
21
|
+
* A primary filter is always visible and is not listed in the "Add filter" component,
|
|
22
|
+
* except for the list layout where it behaves like a secondary filter.
|
|
23
|
+
*/
|
|
12
24
|
isPrimary?: boolean;
|
|
13
25
|
}
|
|
14
26
|
type Operator = 'is' | 'isNot' | 'isAny' | 'isNone' | 'isAll' | 'isNotAll';
|
|
15
|
-
export
|
|
27
|
+
export type AnyItem = Record<string, any>;
|
|
28
|
+
/**
|
|
29
|
+
* A dataview field for a specific property of a data type.
|
|
30
|
+
*/
|
|
31
|
+
export interface Field<Item extends AnyItem> {
|
|
16
32
|
/**
|
|
17
33
|
* The unique identifier of the field.
|
|
18
34
|
*/
|
|
@@ -25,50 +41,57 @@ export interface Field {
|
|
|
25
41
|
* Callback used to retrieve the value of the field from the item.
|
|
26
42
|
* Defaults to `item[ field.id ]`.
|
|
27
43
|
*/
|
|
28
|
-
getValue?: (
|
|
44
|
+
getValue?: (args: {
|
|
29
45
|
item: Item;
|
|
30
46
|
}) => any;
|
|
31
47
|
/**
|
|
32
48
|
* Callback used to render the field. Defaults to `field.getValue`.
|
|
33
49
|
*/
|
|
34
|
-
render?: (
|
|
50
|
+
render?: (args: {
|
|
35
51
|
item: Item;
|
|
36
52
|
}) => ReactNode;
|
|
37
53
|
/**
|
|
38
54
|
* The width of the field column.
|
|
39
55
|
*/
|
|
40
|
-
width
|
|
56
|
+
width?: string | number;
|
|
41
57
|
/**
|
|
42
58
|
* The minimum width of the field column.
|
|
43
59
|
*/
|
|
44
|
-
maxWidth
|
|
60
|
+
maxWidth?: string | number;
|
|
45
61
|
/**
|
|
46
62
|
* The maximum width of the field column.
|
|
47
63
|
*/
|
|
48
|
-
minWidth
|
|
64
|
+
minWidth?: string | number;
|
|
49
65
|
/**
|
|
50
66
|
* Whether the field is sortable.
|
|
51
67
|
*/
|
|
52
|
-
enableSorting
|
|
68
|
+
enableSorting?: boolean;
|
|
53
69
|
/**
|
|
54
70
|
* Whether the field is searchable.
|
|
55
71
|
*/
|
|
56
|
-
enableGlobalSearch
|
|
72
|
+
enableGlobalSearch?: boolean;
|
|
57
73
|
/**
|
|
58
74
|
* Whether the field is filterable.
|
|
59
75
|
*/
|
|
60
|
-
enableHiding
|
|
76
|
+
enableHiding?: boolean;
|
|
61
77
|
/**
|
|
62
78
|
* The list of options to pick from when using the field as a filter.
|
|
63
79
|
*/
|
|
64
|
-
elements
|
|
80
|
+
elements?: Option[];
|
|
65
81
|
/**
|
|
66
82
|
* Filter config for the field.
|
|
67
83
|
*/
|
|
68
|
-
filterBy
|
|
84
|
+
filterBy?: FilterByConfig | undefined;
|
|
69
85
|
}
|
|
70
|
-
export type NormalizedField = Required<Field
|
|
71
|
-
|
|
86
|
+
export type NormalizedField<Item extends AnyItem> = Field<Item> & Required<Pick<Field<Item>, 'header' | 'getValue' | 'render'>>;
|
|
87
|
+
/**
|
|
88
|
+
* A collection of dataview fields for a data type.
|
|
89
|
+
*/
|
|
90
|
+
export type Fields<Item extends AnyItem> = Field<Item>[];
|
|
91
|
+
export type Data<Item extends AnyItem> = Item[];
|
|
92
|
+
/**
|
|
93
|
+
* The filters applied to the dataset.
|
|
94
|
+
*/
|
|
72
95
|
export interface Filter {
|
|
73
96
|
/**
|
|
74
97
|
* The field to filter by.
|
|
@@ -83,7 +106,7 @@ export interface Filter {
|
|
|
83
106
|
*/
|
|
84
107
|
value: any;
|
|
85
108
|
}
|
|
86
|
-
|
|
109
|
+
interface ViewBase {
|
|
87
110
|
/**
|
|
88
111
|
* The layout of the view.
|
|
89
112
|
*/
|
|
@@ -107,7 +130,7 @@ export interface View {
|
|
|
107
130
|
/**
|
|
108
131
|
* The direction to sort by.
|
|
109
132
|
*/
|
|
110
|
-
direction:
|
|
133
|
+
direction: SortDirection;
|
|
111
134
|
};
|
|
112
135
|
/**
|
|
113
136
|
* The active page
|
|
@@ -117,6 +140,115 @@ export interface View {
|
|
|
117
140
|
* The number of items per page
|
|
118
141
|
*/
|
|
119
142
|
perPage?: number;
|
|
143
|
+
/**
|
|
144
|
+
* The hidden fields.
|
|
145
|
+
*/
|
|
146
|
+
hiddenFields: string[];
|
|
147
|
+
}
|
|
148
|
+
export interface ViewList extends ViewBase {
|
|
149
|
+
type: 'list';
|
|
150
|
+
layout: {
|
|
151
|
+
/**
|
|
152
|
+
* The field to use as the primary field.
|
|
153
|
+
*/
|
|
154
|
+
primaryField: string;
|
|
155
|
+
/**
|
|
156
|
+
* The field to use as the media field.
|
|
157
|
+
*/
|
|
158
|
+
mediaField: string;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
export interface ViewGrid extends ViewBase {
|
|
162
|
+
type: 'grid';
|
|
163
|
+
layout: {
|
|
164
|
+
/**
|
|
165
|
+
* The field to use as the primary field.
|
|
166
|
+
*/
|
|
167
|
+
primaryField: string;
|
|
168
|
+
/**
|
|
169
|
+
* The field to use as the media field.
|
|
170
|
+
*/
|
|
171
|
+
mediaField: string;
|
|
172
|
+
/**
|
|
173
|
+
* The fields to use as columns.
|
|
174
|
+
*/
|
|
175
|
+
columnFields: string[];
|
|
176
|
+
/**
|
|
177
|
+
* The fields to use as badge fields.
|
|
178
|
+
*/
|
|
179
|
+
badgeFields: string[];
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
export type View = ViewList | ViewGrid | ViewBase;
|
|
183
|
+
interface ActionBase<Item extends AnyItem> {
|
|
184
|
+
/**
|
|
185
|
+
* The unique identifier of the action.
|
|
186
|
+
*/
|
|
187
|
+
id: string;
|
|
188
|
+
/**
|
|
189
|
+
* The label of the action.
|
|
190
|
+
*/
|
|
191
|
+
label: string;
|
|
192
|
+
/**
|
|
193
|
+
* The icon of the action. (Either a string or an SVG element)
|
|
194
|
+
* This should be IconType from the components package
|
|
195
|
+
* but that import is breaking typescript build for the moment.
|
|
196
|
+
*/
|
|
197
|
+
icon?: any;
|
|
198
|
+
/**
|
|
199
|
+
* Whether the action is disabled.
|
|
200
|
+
*/
|
|
201
|
+
disabled?: boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Whether the action is destructive.
|
|
204
|
+
*/
|
|
205
|
+
isDestructive?: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Whether the action is a primary action.
|
|
208
|
+
*/
|
|
209
|
+
isPrimary?: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* Whether the item passed as an argument supports the current action.
|
|
212
|
+
*/
|
|
213
|
+
isEligible?: (item: Item) => boolean;
|
|
214
|
+
/**
|
|
215
|
+
* Whether the action can be used as a bulk action.
|
|
216
|
+
*/
|
|
217
|
+
supportsBulk?: boolean;
|
|
218
|
+
}
|
|
219
|
+
export interface ActionModal<Item extends AnyItem> extends ActionBase<Item> {
|
|
220
|
+
/**
|
|
221
|
+
* The callback to execute when the action has finished.
|
|
222
|
+
*/
|
|
223
|
+
onActionPerformed: ((items: Item[]) => void) | undefined;
|
|
224
|
+
/**
|
|
225
|
+
* The callback to execute when the action is triggered.
|
|
226
|
+
*/
|
|
227
|
+
onActionStart: ((items: Item[]) => void) | undefined;
|
|
228
|
+
/**
|
|
229
|
+
* Modal to render when the action is triggered.
|
|
230
|
+
*/
|
|
231
|
+
RenderModal: ({ items, closeModal, onActionStart, onActionPerformed, }: {
|
|
232
|
+
items: Item[];
|
|
233
|
+
closeModal?: () => void;
|
|
234
|
+
onActionStart?: (items: Item[]) => void;
|
|
235
|
+
onActionPerformed?: (items: Item[]) => void;
|
|
236
|
+
}) => ReactElement;
|
|
237
|
+
/**
|
|
238
|
+
* Whether to hide the modal header.
|
|
239
|
+
*/
|
|
240
|
+
hideModalHeader?: boolean;
|
|
241
|
+
/**
|
|
242
|
+
* The header of the modal.
|
|
243
|
+
*/
|
|
244
|
+
modalHeader?: string;
|
|
245
|
+
}
|
|
246
|
+
export interface ActionButton<Item extends AnyItem> extends ActionBase<AnyItem> {
|
|
247
|
+
/**
|
|
248
|
+
* The callback to execute when the action is triggered.
|
|
249
|
+
*/
|
|
250
|
+
callback: (items: Item[]) => void;
|
|
120
251
|
}
|
|
252
|
+
export type Action<Item extends AnyItem> = ActionModal<Item> | ActionButton<Item>;
|
|
121
253
|
export {};
|
|
122
254
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3C;;GAEG;AACH,UAAU,MAAM,CAAE,KAAK,SAAS,GAAG,GAAG,GAAG;IACxC,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACd;AAED,UAAU,cAAc;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IAEvB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,KAAK,QAAQ,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AAE3E,MAAM,MAAM,OAAO,GAAG,MAAM,CAAE,MAAM,EAAE,GAAG,CAAE,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,KAAK,CAAE,IAAI,SAAS,OAAO;IAC3C;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAE,IAAI,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,KAAM,GAAG,CAAC;IAE3C;;OAEG;IACH,MAAM,CAAC,EAAE,CAAE,IAAI,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,K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,WAAW,CAAE,IAAI,SAAS,OAAO,CACjD,SAAQ,UAAU,CAAE,IAAI,CAAE;IAC1B;;OAEG;IACH,iBAAiB,EAAE,CAAE,CAAE,KAAK,EAAE,IAAI,EAAE,KAAM,IAAI,CAAE,GAAG,SAAS,CAAC;IAE7D;;OAEG;IACH,aAAa,EAAE,CAAE,CAAE,KAAK,EAAE,IAAI,EAAE,KAAM,IAAI,CAAE,GAAG,SAAS,CAAC;IAEzD;;OAEG;IACH,WAAW,EAAE,CAAE,EACd,KAAK,EACL,UAAU,EACV,aAAa,EACb,iBAAiB,GACjB,EAAE;QACF,KAAK,EAAE,IAAI,EAAE,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;QACxB,aAAa,CAAC,EAAE,CAAE,KAAK,EAAE,IAAI,EAAE,KAAM,IAAI,CAAC;QAC1C,iBAAiB,CAAC,EAAE,CAAE,KAAK,EAAE,IAAI,EAAE,KAAM,IAAI,CAAC;KAC9C,KAAM,YAAY,CAAC;IAEpB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY,CAAE,IAAI,SAAS,OAAO,CAClD,SAAQ,UAAU,CAAE,OAAO,CAAE;IAC7B;;OAEG;IACH,QAAQ,EAAE,CAAE,KAAK,EAAE,IAAI,EAAE,KAAM,IAAI,CAAC;CACpC;AAED,MAAM,MAAM,MAAM,CAAE,IAAI,SAAS,OAAO,IACrC,WAAW,CAAE,IAAI,CAAE,GACnB,YAAY,CAAE,IAAI,CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.js"],"names":[],"mappings":"AAWO,mDAoCN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-actions.d.ts","sourceRoot":"","sources":["../src/view-actions.js"],"names":[],"mappings":";AA4PA,wEAoCI"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Action, AnyItem, NormalizedField, ViewGrid as ViewGridType } from './types';
|
|
3
|
+
interface ViewGridProps<Item extends AnyItem> {
|
|
4
|
+
actions: Action<Item>[];
|
|
5
|
+
data: Item[];
|
|
6
|
+
fields: NormalizedField<Item>[];
|
|
7
|
+
getItemId: (item: Item) => string;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
onSelectionChange: (items: Item[]) => void;
|
|
10
|
+
selection: string[];
|
|
11
|
+
view: ViewGridType;
|
|
12
|
+
}
|
|
13
|
+
export default function ViewGrid<Item extends AnyItem>({ actions, data, fields, getItemId, isLoading, onSelectionChange, selection, view, }: ViewGridProps<Item>): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=view-grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-grid.d.ts","sourceRoot":"","sources":["../src/view-grid.tsx"],"names":[],"mappings":";AAwBA,OAAO,KAAK,EACX,MAAM,EACN,OAAO,EACP,eAAe,EACf,QAAQ,IAAI,YAAY,EACxB,MAAM,SAAS,CAAC;AAgBjB,UAAU,aAAa,CAAE,IAAI,SAAS,OAAO;IAC5C,OAAO,EAAE,MAAM,CAAE,IAAI,CAAE,EAAE,CAAC;IAC1B,IAAI,EAAE,IAAI,EAAE,CAAC;IACb,MAAM,EAAE,eAAe,CAAE,IAAI,CAAE,EAAE,CAAC;IAClC,SAAS,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,MAAM,CAAC;IACpC,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,CAAE,KAAK,EAAE,IAAI,EAAE,KAAM,IAAI,CAAC;IAC7C,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,EAAE,YAAY,CAAC;CACnB;AAuJD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAE,IAAI,SAAS,OAAO,EAAI,EACzD,OAAO,EACP,IAAI,EACJ,MAAM,EACN,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,IAAI,GACJ,EAAE,aAAa,CAAE,IAAI,CAAE,+BAsEvB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Action, AnyItem, NormalizedField, ViewList as ViewListType } from './types';
|
|
3
|
+
interface ListViewProps<Item extends AnyItem> {
|
|
4
|
+
actions: Action<Item>[];
|
|
5
|
+
data: Item[];
|
|
6
|
+
fields: NormalizedField<Item>[];
|
|
7
|
+
getItemId: (item: Item) => string;
|
|
8
|
+
id: string;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
onSelectionChange: (selection: Item[]) => void;
|
|
11
|
+
selection: string[];
|
|
12
|
+
view: ViewListType;
|
|
13
|
+
}
|
|
14
|
+
export default function ViewList<Item extends AnyItem>(props: ListViewProps<Item>): import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=view-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-list.d.ts","sourceRoot":"","sources":["../src/view-list.tsx"],"names":[],"mappings":";AAkCA,OAAO,KAAK,EACX,MAAM,EACN,OAAO,EACP,eAAe,EACf,QAAQ,IAAI,YAAY,EACxB,MAAM,SAAS,CAAC;AAIjB,UAAU,aAAa,CAAE,IAAI,SAAS,OAAO;IAC5C,OAAO,EAAE,MAAM,CAAE,IAAI,CAAE,EAAE,CAAC;IAC1B,IAAI,EAAE,IAAI,EAAE,CAAC;IACb,MAAM,EAAE,eAAe,CAAE,IAAI,CAAE,EAAE,CAAC;IAClC,SAAS,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,MAAM,CAAC;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,CAAE,SAAS,EAAE,IAAI,EAAE,KAAM,IAAI,CAAC;IACjD,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,EAAE,YAAY,CAAC;CACnB;AAmQD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAE,IAAI,SAAS,OAAO,EACrD,KAAK,EAAE,aAAa,CAAE,IAAI,CAAE,+BA2G5B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default ViewTable;
|
|
2
|
+
declare function ViewTable({ actions, data, fields, getItemId, isLoading, onChangeView, onSelectionChange, selection, setOpenedFilter, view, }: {
|
|
3
|
+
actions: any;
|
|
4
|
+
data: any;
|
|
5
|
+
fields: any;
|
|
6
|
+
getItemId: any;
|
|
7
|
+
isLoading?: boolean | undefined;
|
|
8
|
+
onChangeView: any;
|
|
9
|
+
onSelectionChange: any;
|
|
10
|
+
selection: any;
|
|
11
|
+
setOpenedFilter: any;
|
|
12
|
+
view: any;
|
|
13
|
+
}): import("react").JSX.Element | undefined;
|
|
14
|
+
//# sourceMappingURL=view-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-table.d.ts","sourceRoot":"","sources":["../src/view-table.js"],"names":[],"mappings":";AA2WA;;;;;;;;;;;4CAuKC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/dataviews",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
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",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@ariakit/react": "^0.3.12",
|
|
31
31
|
"@babel/runtime": "^7.16.0",
|
|
32
|
-
"@wordpress/a11y": "^3.
|
|
33
|
-
"@wordpress/components": "^27.
|
|
34
|
-
"@wordpress/compose": "^6.
|
|
35
|
-
"@wordpress/element": "^5.
|
|
36
|
-
"@wordpress/i18n": "^4.
|
|
37
|
-
"@wordpress/icons": "^9.
|
|
38
|
-
"@wordpress/keycodes": "^3.
|
|
39
|
-
"@wordpress/primitives": "^3.
|
|
40
|
-
"@wordpress/private-apis": "^0.
|
|
41
|
-
"
|
|
32
|
+
"@wordpress/a11y": "^3.58.0",
|
|
33
|
+
"@wordpress/components": "^27.6.0",
|
|
34
|
+
"@wordpress/compose": "^6.35.0",
|
|
35
|
+
"@wordpress/element": "^5.35.0",
|
|
36
|
+
"@wordpress/i18n": "^4.58.0",
|
|
37
|
+
"@wordpress/icons": "^9.49.0",
|
|
38
|
+
"@wordpress/keycodes": "^3.58.0",
|
|
39
|
+
"@wordpress/primitives": "^3.56.0",
|
|
40
|
+
"@wordpress/private-apis": "^0.40.0",
|
|
41
|
+
"clsx": "^2.1.1",
|
|
42
42
|
"remove-accents": "^0.5.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "42f38f287506a6b3ed8ccba839b18ad066821044"
|
|
51
51
|
}
|