@procore/saved-views 1.0.1-alpha.2 → 1.1.0-alpha.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/dist/legacy/index.d.mts +11 -30
- package/dist/legacy/index.d.ts +11 -30
- package/dist/legacy/index.js +343 -377
- package/dist/legacy/index.mjs +290 -324
- package/dist/modern/index.d.mts +11 -30
- package/dist/modern/index.d.ts +11 -30
- package/dist/modern/index.js +343 -376
- package/dist/modern/index.mjs +290 -323
- package/package.json +1 -1
package/dist/legacy/index.d.mts
CHANGED
|
@@ -4,7 +4,6 @@ import React__default from 'react';
|
|
|
4
4
|
import { DataTableConfig, TableApi, ColumnDefinition } from '@procore/data-table';
|
|
5
5
|
import { ColumnState, FilterModel, GridApi } from 'ag-grid-community';
|
|
6
6
|
import * as styled_components from 'styled-components';
|
|
7
|
-
import { UseQueryResult, UseMutationResult } from '@tanstack/react-query';
|
|
8
7
|
|
|
9
8
|
declare function getTranslations(envLocale: Locale): Partial<MapLocalesToTranslations>;
|
|
10
9
|
|
|
@@ -16,7 +15,7 @@ declare const useSavedViewsPanel: (domain: string, tableName: string) => {
|
|
|
16
15
|
interface IQueryInputProps {
|
|
17
16
|
domain: string;
|
|
18
17
|
tableName: string;
|
|
19
|
-
projectId
|
|
18
|
+
projectId?: number;
|
|
20
19
|
companyId: number;
|
|
21
20
|
}
|
|
22
21
|
|
|
@@ -31,8 +30,8 @@ interface ISmartGridConfig {
|
|
|
31
30
|
filterState: FilterModel;
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
declare const
|
|
35
|
-
type ViewLevel = (typeof
|
|
33
|
+
declare const PROJECT_LEVEL_TOOL_VIEW_LEVELS: readonly ["company", "project", "personal"];
|
|
34
|
+
type ViewLevel = (typeof PROJECT_LEVEL_TOOL_VIEW_LEVELS)[number];
|
|
36
35
|
|
|
37
36
|
interface ISavedView {
|
|
38
37
|
id: string;
|
|
@@ -56,32 +55,13 @@ interface ISmartGridDefaultViewConfig extends IDefaultViewConfig<ISmartGridConfi
|
|
|
56
55
|
|
|
57
56
|
type TableProvider = 'smart-grid' | 'data-table';
|
|
58
57
|
|
|
59
|
-
interface ISavedViewError {
|
|
60
|
-
code: string;
|
|
61
|
-
message: string | Record<string, string[]> | Record<string, string>;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
interface IPermissions {
|
|
65
|
-
can_create_project_saved_views: boolean;
|
|
66
|
-
can_create_company_saved_views: boolean;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
interface ISavedViewsBackend {
|
|
70
|
-
useSavedViewsQuery: (props: IQueryInputProps) => UseQueryResult<ISavedView[], Error>;
|
|
71
|
-
useSavedViewsPermissions: (props: IQueryInputProps) => UseQueryResult<IPermissions, Error>;
|
|
72
|
-
useCreateSavedView: (props: IQueryInputProps) => UseMutationResult<ISavedView, ISavedViewError, ISavedView, unknown>;
|
|
73
|
-
useUpdateSavedView: (props: IQueryInputProps) => UseMutationResult<ISavedView, ISavedViewError, ISavedView, unknown>;
|
|
74
|
-
useDeleteSavedView: (props: IQueryInputProps) => UseMutationResult<ISavedView, ISavedViewError, ISavedView, unknown>;
|
|
75
|
-
useFetchSavedViewById: (savedViewToken: string | null, queryInput: IQueryInputProps, enabled: boolean) => UseQueryResult<ISavedView, Error>;
|
|
76
|
-
}
|
|
77
58
|
interface IBaseSavedViewsProps {
|
|
78
59
|
tableName: string;
|
|
79
60
|
domain: string;
|
|
80
|
-
userId:
|
|
81
|
-
projectId
|
|
61
|
+
userId: number;
|
|
62
|
+
projectId?: number;
|
|
82
63
|
companyId: number;
|
|
83
64
|
stickyViewsKey: string;
|
|
84
|
-
backend?: ISavedViewsBackend;
|
|
85
65
|
}
|
|
86
66
|
interface ISavedViewsProps extends Omit<IBaseSavedViewsProps, 'stickyViewsKey'> {
|
|
87
67
|
defaultView: ISavedView;
|
|
@@ -101,10 +81,14 @@ interface IDataTableSavedViewsExternalConsumerProps extends IBaseSavedViewsProps
|
|
|
101
81
|
|
|
102
82
|
interface ISmartGridSavedViewsExternalConsumerProps extends IBaseSavedViewsProps {
|
|
103
83
|
gridApi: GridApi;
|
|
104
|
-
transformSettings?: (config: ISmartGridConfig) => ISmartGridConfig;
|
|
105
84
|
defaultViews: ISmartGridDefaultViewConfig[];
|
|
106
85
|
}
|
|
107
86
|
|
|
87
|
+
interface IPermissions {
|
|
88
|
+
can_create_project_saved_views: boolean;
|
|
89
|
+
can_create_company_saved_views: boolean;
|
|
90
|
+
}
|
|
91
|
+
|
|
108
92
|
declare enum ModalType {
|
|
109
93
|
CREATE = "create",
|
|
110
94
|
UPDATE = "update",
|
|
@@ -124,10 +108,9 @@ interface IPanelContentProps {
|
|
|
124
108
|
provider: TableProvider;
|
|
125
109
|
defaultView: ISavedView;
|
|
126
110
|
presetViews: ISavedView[];
|
|
127
|
-
userId:
|
|
111
|
+
userId: number;
|
|
128
112
|
savedViews?: ISavedView[];
|
|
129
113
|
onClearTemporary?: () => void;
|
|
130
|
-
backend: ISavedViewsBackend;
|
|
131
114
|
}
|
|
132
115
|
|
|
133
116
|
type SavedViewCollectionMenuItemProps = {
|
|
@@ -146,7 +129,6 @@ type SavedViewCollectionMenuItemProps = {
|
|
|
146
129
|
isUpdateProcessing?: boolean;
|
|
147
130
|
permissions?: IPermissions;
|
|
148
131
|
onClearTemporary?: () => void;
|
|
149
|
-
enableSharingViews?: boolean;
|
|
150
132
|
};
|
|
151
133
|
declare const SavedViewCollectionMenuItem: (props: SavedViewCollectionMenuItemProps) => React.JSX.Element;
|
|
152
134
|
|
|
@@ -175,7 +157,6 @@ type FormModalProps = {
|
|
|
175
157
|
onSelect: (item: ISavedView) => void;
|
|
176
158
|
setOpenEditCreateModal: (open: boolean) => void;
|
|
177
159
|
defaultView: ISavedView;
|
|
178
|
-
backend: ISavedViewsBackend;
|
|
179
160
|
};
|
|
180
161
|
declare const FormModal: React__default.FC<FormModalProps>;
|
|
181
162
|
|
package/dist/legacy/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import React__default from 'react';
|
|
|
4
4
|
import { DataTableConfig, TableApi, ColumnDefinition } from '@procore/data-table';
|
|
5
5
|
import { ColumnState, FilterModel, GridApi } from 'ag-grid-community';
|
|
6
6
|
import * as styled_components from 'styled-components';
|
|
7
|
-
import { UseQueryResult, UseMutationResult } from '@tanstack/react-query';
|
|
8
7
|
|
|
9
8
|
declare function getTranslations(envLocale: Locale): Partial<MapLocalesToTranslations>;
|
|
10
9
|
|
|
@@ -16,7 +15,7 @@ declare const useSavedViewsPanel: (domain: string, tableName: string) => {
|
|
|
16
15
|
interface IQueryInputProps {
|
|
17
16
|
domain: string;
|
|
18
17
|
tableName: string;
|
|
19
|
-
projectId
|
|
18
|
+
projectId?: number;
|
|
20
19
|
companyId: number;
|
|
21
20
|
}
|
|
22
21
|
|
|
@@ -31,8 +30,8 @@ interface ISmartGridConfig {
|
|
|
31
30
|
filterState: FilterModel;
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
declare const
|
|
35
|
-
type ViewLevel = (typeof
|
|
33
|
+
declare const PROJECT_LEVEL_TOOL_VIEW_LEVELS: readonly ["company", "project", "personal"];
|
|
34
|
+
type ViewLevel = (typeof PROJECT_LEVEL_TOOL_VIEW_LEVELS)[number];
|
|
36
35
|
|
|
37
36
|
interface ISavedView {
|
|
38
37
|
id: string;
|
|
@@ -56,32 +55,13 @@ interface ISmartGridDefaultViewConfig extends IDefaultViewConfig<ISmartGridConfi
|
|
|
56
55
|
|
|
57
56
|
type TableProvider = 'smart-grid' | 'data-table';
|
|
58
57
|
|
|
59
|
-
interface ISavedViewError {
|
|
60
|
-
code: string;
|
|
61
|
-
message: string | Record<string, string[]> | Record<string, string>;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
interface IPermissions {
|
|
65
|
-
can_create_project_saved_views: boolean;
|
|
66
|
-
can_create_company_saved_views: boolean;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
interface ISavedViewsBackend {
|
|
70
|
-
useSavedViewsQuery: (props: IQueryInputProps) => UseQueryResult<ISavedView[], Error>;
|
|
71
|
-
useSavedViewsPermissions: (props: IQueryInputProps) => UseQueryResult<IPermissions, Error>;
|
|
72
|
-
useCreateSavedView: (props: IQueryInputProps) => UseMutationResult<ISavedView, ISavedViewError, ISavedView, unknown>;
|
|
73
|
-
useUpdateSavedView: (props: IQueryInputProps) => UseMutationResult<ISavedView, ISavedViewError, ISavedView, unknown>;
|
|
74
|
-
useDeleteSavedView: (props: IQueryInputProps) => UseMutationResult<ISavedView, ISavedViewError, ISavedView, unknown>;
|
|
75
|
-
useFetchSavedViewById: (savedViewToken: string | null, queryInput: IQueryInputProps, enabled: boolean) => UseQueryResult<ISavedView, Error>;
|
|
76
|
-
}
|
|
77
58
|
interface IBaseSavedViewsProps {
|
|
78
59
|
tableName: string;
|
|
79
60
|
domain: string;
|
|
80
|
-
userId:
|
|
81
|
-
projectId
|
|
61
|
+
userId: number;
|
|
62
|
+
projectId?: number;
|
|
82
63
|
companyId: number;
|
|
83
64
|
stickyViewsKey: string;
|
|
84
|
-
backend?: ISavedViewsBackend;
|
|
85
65
|
}
|
|
86
66
|
interface ISavedViewsProps extends Omit<IBaseSavedViewsProps, 'stickyViewsKey'> {
|
|
87
67
|
defaultView: ISavedView;
|
|
@@ -101,10 +81,14 @@ interface IDataTableSavedViewsExternalConsumerProps extends IBaseSavedViewsProps
|
|
|
101
81
|
|
|
102
82
|
interface ISmartGridSavedViewsExternalConsumerProps extends IBaseSavedViewsProps {
|
|
103
83
|
gridApi: GridApi;
|
|
104
|
-
transformSettings?: (config: ISmartGridConfig) => ISmartGridConfig;
|
|
105
84
|
defaultViews: ISmartGridDefaultViewConfig[];
|
|
106
85
|
}
|
|
107
86
|
|
|
87
|
+
interface IPermissions {
|
|
88
|
+
can_create_project_saved_views: boolean;
|
|
89
|
+
can_create_company_saved_views: boolean;
|
|
90
|
+
}
|
|
91
|
+
|
|
108
92
|
declare enum ModalType {
|
|
109
93
|
CREATE = "create",
|
|
110
94
|
UPDATE = "update",
|
|
@@ -124,10 +108,9 @@ interface IPanelContentProps {
|
|
|
124
108
|
provider: TableProvider;
|
|
125
109
|
defaultView: ISavedView;
|
|
126
110
|
presetViews: ISavedView[];
|
|
127
|
-
userId:
|
|
111
|
+
userId: number;
|
|
128
112
|
savedViews?: ISavedView[];
|
|
129
113
|
onClearTemporary?: () => void;
|
|
130
|
-
backend: ISavedViewsBackend;
|
|
131
114
|
}
|
|
132
115
|
|
|
133
116
|
type SavedViewCollectionMenuItemProps = {
|
|
@@ -146,7 +129,6 @@ type SavedViewCollectionMenuItemProps = {
|
|
|
146
129
|
isUpdateProcessing?: boolean;
|
|
147
130
|
permissions?: IPermissions;
|
|
148
131
|
onClearTemporary?: () => void;
|
|
149
|
-
enableSharingViews?: boolean;
|
|
150
132
|
};
|
|
151
133
|
declare const SavedViewCollectionMenuItem: (props: SavedViewCollectionMenuItemProps) => React.JSX.Element;
|
|
152
134
|
|
|
@@ -175,7 +157,6 @@ type FormModalProps = {
|
|
|
175
157
|
onSelect: (item: ISavedView) => void;
|
|
176
158
|
setOpenEditCreateModal: (open: boolean) => void;
|
|
177
159
|
defaultView: ISavedView;
|
|
178
|
-
backend: ISavedViewsBackend;
|
|
179
160
|
};
|
|
180
161
|
declare const FormModal: React__default.FC<FormModalProps>;
|
|
181
162
|
|