@procore/saved-views 1.0.0 → 1.0.1-alpha.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/dist/legacy/index.d.mts +26 -7
- package/dist/legacy/index.d.ts +26 -7
- package/dist/legacy/index.js +342 -284
- package/dist/legacy/index.mjs +289 -231
- package/dist/modern/index.d.mts +26 -7
- package/dist/modern/index.d.ts +26 -7
- package/dist/modern/index.js +342 -284
- package/dist/modern/index.mjs +289 -231
- package/package.json +1 -1
package/dist/modern/index.d.mts
CHANGED
|
@@ -4,6 +4,7 @@ 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';
|
|
7
8
|
|
|
8
9
|
declare function getTranslations(envLocale: Locale): Partial<MapLocalesToTranslations>;
|
|
9
10
|
|
|
@@ -55,13 +56,32 @@ interface ISmartGridDefaultViewConfig extends IDefaultViewConfig<ISmartGridConfi
|
|
|
55
56
|
|
|
56
57
|
type TableProvider = 'smart-grid' | 'data-table';
|
|
57
58
|
|
|
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
|
+
}
|
|
58
77
|
interface IBaseSavedViewsProps {
|
|
59
78
|
tableName: string;
|
|
60
79
|
domain: string;
|
|
61
|
-
userId:
|
|
80
|
+
userId: string;
|
|
62
81
|
projectId: number;
|
|
63
82
|
companyId: number;
|
|
64
83
|
stickyViewsKey: string;
|
|
84
|
+
backend?: ISavedViewsBackend;
|
|
65
85
|
}
|
|
66
86
|
interface ISavedViewsProps extends Omit<IBaseSavedViewsProps, 'stickyViewsKey'> {
|
|
67
87
|
defaultView: ISavedView;
|
|
@@ -81,14 +101,10 @@ interface IDataTableSavedViewsExternalConsumerProps extends IBaseSavedViewsProps
|
|
|
81
101
|
|
|
82
102
|
interface ISmartGridSavedViewsExternalConsumerProps extends IBaseSavedViewsProps {
|
|
83
103
|
gridApi: GridApi;
|
|
104
|
+
transformSettings?: (config: ISmartGridConfig) => ISmartGridConfig;
|
|
84
105
|
defaultViews: ISmartGridDefaultViewConfig[];
|
|
85
106
|
}
|
|
86
107
|
|
|
87
|
-
interface IPermissions {
|
|
88
|
-
can_create_project_saved_views: boolean;
|
|
89
|
-
can_create_company_saved_views: boolean;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
108
|
declare enum ModalType {
|
|
93
109
|
CREATE = "create",
|
|
94
110
|
UPDATE = "update",
|
|
@@ -108,9 +124,10 @@ interface IPanelContentProps {
|
|
|
108
124
|
provider: TableProvider;
|
|
109
125
|
defaultView: ISavedView;
|
|
110
126
|
presetViews: ISavedView[];
|
|
111
|
-
userId:
|
|
127
|
+
userId: string;
|
|
112
128
|
savedViews?: ISavedView[];
|
|
113
129
|
onClearTemporary?: () => void;
|
|
130
|
+
backend: ISavedViewsBackend;
|
|
114
131
|
}
|
|
115
132
|
|
|
116
133
|
type SavedViewCollectionMenuItemProps = {
|
|
@@ -129,6 +146,7 @@ type SavedViewCollectionMenuItemProps = {
|
|
|
129
146
|
isUpdateProcessing?: boolean;
|
|
130
147
|
permissions?: IPermissions;
|
|
131
148
|
onClearTemporary?: () => void;
|
|
149
|
+
enableSharingViews?: boolean;
|
|
132
150
|
};
|
|
133
151
|
declare const SavedViewCollectionMenuItem: (props: SavedViewCollectionMenuItemProps) => React.JSX.Element;
|
|
134
152
|
|
|
@@ -157,6 +175,7 @@ type FormModalProps = {
|
|
|
157
175
|
onSelect: (item: ISavedView) => void;
|
|
158
176
|
setOpenEditCreateModal: (open: boolean) => void;
|
|
159
177
|
defaultView: ISavedView;
|
|
178
|
+
backend: ISavedViewsBackend;
|
|
160
179
|
};
|
|
161
180
|
declare const FormModal: React__default.FC<FormModalProps>;
|
|
162
181
|
|
package/dist/modern/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ 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';
|
|
7
8
|
|
|
8
9
|
declare function getTranslations(envLocale: Locale): Partial<MapLocalesToTranslations>;
|
|
9
10
|
|
|
@@ -55,13 +56,32 @@ interface ISmartGridDefaultViewConfig extends IDefaultViewConfig<ISmartGridConfi
|
|
|
55
56
|
|
|
56
57
|
type TableProvider = 'smart-grid' | 'data-table';
|
|
57
58
|
|
|
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
|
+
}
|
|
58
77
|
interface IBaseSavedViewsProps {
|
|
59
78
|
tableName: string;
|
|
60
79
|
domain: string;
|
|
61
|
-
userId:
|
|
80
|
+
userId: string;
|
|
62
81
|
projectId: number;
|
|
63
82
|
companyId: number;
|
|
64
83
|
stickyViewsKey: string;
|
|
84
|
+
backend?: ISavedViewsBackend;
|
|
65
85
|
}
|
|
66
86
|
interface ISavedViewsProps extends Omit<IBaseSavedViewsProps, 'stickyViewsKey'> {
|
|
67
87
|
defaultView: ISavedView;
|
|
@@ -81,14 +101,10 @@ interface IDataTableSavedViewsExternalConsumerProps extends IBaseSavedViewsProps
|
|
|
81
101
|
|
|
82
102
|
interface ISmartGridSavedViewsExternalConsumerProps extends IBaseSavedViewsProps {
|
|
83
103
|
gridApi: GridApi;
|
|
104
|
+
transformSettings?: (config: ISmartGridConfig) => ISmartGridConfig;
|
|
84
105
|
defaultViews: ISmartGridDefaultViewConfig[];
|
|
85
106
|
}
|
|
86
107
|
|
|
87
|
-
interface IPermissions {
|
|
88
|
-
can_create_project_saved_views: boolean;
|
|
89
|
-
can_create_company_saved_views: boolean;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
108
|
declare enum ModalType {
|
|
93
109
|
CREATE = "create",
|
|
94
110
|
UPDATE = "update",
|
|
@@ -108,9 +124,10 @@ interface IPanelContentProps {
|
|
|
108
124
|
provider: TableProvider;
|
|
109
125
|
defaultView: ISavedView;
|
|
110
126
|
presetViews: ISavedView[];
|
|
111
|
-
userId:
|
|
127
|
+
userId: string;
|
|
112
128
|
savedViews?: ISavedView[];
|
|
113
129
|
onClearTemporary?: () => void;
|
|
130
|
+
backend: ISavedViewsBackend;
|
|
114
131
|
}
|
|
115
132
|
|
|
116
133
|
type SavedViewCollectionMenuItemProps = {
|
|
@@ -129,6 +146,7 @@ type SavedViewCollectionMenuItemProps = {
|
|
|
129
146
|
isUpdateProcessing?: boolean;
|
|
130
147
|
permissions?: IPermissions;
|
|
131
148
|
onClearTemporary?: () => void;
|
|
149
|
+
enableSharingViews?: boolean;
|
|
132
150
|
};
|
|
133
151
|
declare const SavedViewCollectionMenuItem: (props: SavedViewCollectionMenuItemProps) => React.JSX.Element;
|
|
134
152
|
|
|
@@ -157,6 +175,7 @@ type FormModalProps = {
|
|
|
157
175
|
onSelect: (item: ISavedView) => void;
|
|
158
176
|
setOpenEditCreateModal: (open: boolean) => void;
|
|
159
177
|
defaultView: ISavedView;
|
|
178
|
+
backend: ISavedViewsBackend;
|
|
160
179
|
};
|
|
161
180
|
declare const FormModal: React__default.FC<FormModalProps>;
|
|
162
181
|
|