@procore/saved-views 6.0.2 → 6.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.
Files changed (34) hide show
  1. package/README.md +13 -2
  2. package/dist/legacy/adapters/hub-data-loader.d.mts +22 -0
  3. package/dist/legacy/adapters/hub-data-loader.d.ts +22 -0
  4. package/dist/legacy/adapters/hub-data-loader.js +273 -0
  5. package/dist/legacy/adapters/hub-data-loader.mjs +273 -0
  6. package/dist/legacy/chunk-6DZX6EAA.mjs +37 -0
  7. package/dist/legacy/chunk-QGM4M3NI.js +37 -0
  8. package/dist/legacy/index.d.mts +22 -3
  9. package/dist/legacy/index.d.ts +22 -3
  10. package/dist/legacy/index.js +755 -487
  11. package/dist/legacy/index.mjs +493 -268
  12. package/dist/legacy/transport/default.d.mts +15 -0
  13. package/dist/legacy/transport/default.d.ts +15 -0
  14. package/dist/legacy/transport/default.js +104 -0
  15. package/dist/legacy/transport/default.mjs +104 -0
  16. package/dist/legacy/types-BWhJ-on3.d.mts +109 -0
  17. package/dist/legacy/types-BWhJ-on3.d.ts +109 -0
  18. package/dist/modern/adapters/hub-data-loader.d.mts +22 -0
  19. package/dist/modern/adapters/hub-data-loader.d.ts +22 -0
  20. package/dist/modern/adapters/hub-data-loader.js +270 -0
  21. package/dist/modern/adapters/hub-data-loader.mjs +270 -0
  22. package/dist/modern/chunk-6DZX6EAA.mjs +37 -0
  23. package/dist/modern/chunk-QGM4M3NI.js +37 -0
  24. package/dist/modern/index.d.mts +22 -3
  25. package/dist/modern/index.d.ts +22 -3
  26. package/dist/modern/index.js +807 -540
  27. package/dist/modern/index.mjs +492 -268
  28. package/dist/modern/transport/default.d.mts +15 -0
  29. package/dist/modern/transport/default.d.ts +15 -0
  30. package/dist/modern/transport/default.js +104 -0
  31. package/dist/modern/transport/default.mjs +104 -0
  32. package/dist/modern/types-BWhJ-on3.d.mts +109 -0
  33. package/dist/modern/types-BWhJ-on3.d.ts +109 -0
  34. package/package.json +35 -2
@@ -0,0 +1,37 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error('Dynamic require of "' + x + '" is not supported');
12
+ });
13
+ var __commonJS = (cb, mod) => function __require2() {
14
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from))
19
+ if (!__hasOwnProp.call(to, key) && key !== except)
20
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+
33
+
34
+
35
+
36
+
37
+ exports.__require = __require; exports.__commonJS = __commonJS; exports.__toESM = __toESM;
@@ -1,17 +1,20 @@
1
1
  import { Locale } from '@procore/globalization-toolkit';
2
2
  import * as React$1 from 'react';
3
- import React__default from 'react';
3
+ import React__default, { PropsWithChildren } 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 _procore_core_react_dist_Panel_Panel_types from '@procore/core-react/dist/Panel/Panel.types';
7
7
  import * as styled_components_dist_types from 'styled-components/dist/types';
8
8
  import * as _procore_core_react from '@procore/core-react';
9
+ import { S as SavedViewsTransport } from './types-BWhJ-on3.mjs';
10
+ export { a as SavedViewsCacheControl, b as SavedViewsHttpRequest, c as SavedViewsMutationArgs, d as SavedViewsMutationResult, e as SavedViewsQueryArgs, f as SavedViewsQueryResult, g as SavedViewsUrlAdapter } from './types-BWhJ-on3.mjs';
9
11
 
10
12
  declare function getTranslations(envLocale: Locale): Record<string, object>;
11
13
 
12
14
  declare const useSavedViewsPanel: (domain: string, tableName: string) => {
13
15
  isOpen: boolean;
14
16
  SavedViewsButton: () => React__default.JSX.Element;
17
+ SavedViewsProvider: ({ children, }: React__default.PropsWithChildren) => React__default.JSX.Element;
15
18
  };
16
19
 
17
20
  interface IQueryInputProps {
@@ -64,6 +67,15 @@ interface IBaseSavedViewsProps {
64
67
  projectId?: number;
65
68
  companyId: number;
66
69
  stickyViewsKey: string;
70
+ /**
71
+ * Optional transport that injects HTTP, query/mutation, cache, and URL
72
+ * adapters. Defaults to a transport backed by `@procore/core-http`,
73
+ * `@tanstack/react-query`, and `react-router-dom` (today's behavior).
74
+ *
75
+ * Hub Card consumers should pass the result of `createHubDataLoaderTransport`
76
+ * from `@procore/saved-views/adapters/hub-data-loader`.
77
+ */
78
+ transport?: SavedViewsTransport;
67
79
  }
68
80
  interface ISavedViewsProps extends Omit<IBaseSavedViewsProps, 'stickyViewsKey'> {
69
81
  defaultView: ISavedView;
@@ -116,6 +128,13 @@ interface IPanelContentProps {
116
128
  onClearTemporary?: () => void;
117
129
  }
118
130
 
131
+ interface SavedViewsSelectionContextValue {
132
+ selectedView: ISavedView | null;
133
+ setSelectedView: (view: ISavedView | null) => void;
134
+ }
135
+ declare const SavedViewsSelectionProvider: ({ children, }: PropsWithChildren) => React__default.JSX.Element;
136
+ declare const useSavedViewsSelection: () => SavedViewsSelectionContextValue | null;
137
+
119
138
  type SavedViewCollectionMenuItemProps = {
120
139
  item: ISavedView;
121
140
  key?: string;
@@ -158,7 +177,7 @@ declare const ExpandedPanel: styled_components_dist_types.IStyledComponentBase<"
158
177
 
159
178
  declare const PanelContent: (props: IPanelContentProps) => React__default.JSX.Element;
160
179
 
161
- declare const SavedViews: (props: ISavedViewsProps) => React__default.JSX.Element;
180
+ declare const SavedViews: (props: ISavedViewsProps) => React__default.JSX.Element | null;
162
181
 
163
182
  type Props = {
164
183
  onDelete(): void;
@@ -189,4 +208,4 @@ interface IDataTableSavedViewsRef {
189
208
  }
190
209
  declare const DataTableSavedViews: React__default.ForwardRefExoticComponent<IDataTableSavedViewsExternalConsumerProps & React__default.RefAttributes<IDataTableSavedViewsRef>>;
191
210
 
192
- export { DataTableSavedViews, ExpandedPanel, FormModal, type IDataTableDefaultViewConfig, type IDataTableSavedViewsRef, type ISmartGridDefaultViewConfig, PanelContent, SavedViewCollectionMenuItem, SavedViews, SavedViewsDeleteConfirmationModalShared, SmartGridSavedViews, getTranslations, useSavedViewsPanel };
211
+ export { DataTableSavedViews, ExpandedPanel, FormModal, type IDataTableDefaultViewConfig, type IDataTableSavedViewsRef, type ISmartGridDefaultViewConfig, PanelContent, SavedViewCollectionMenuItem, SavedViews, SavedViewsDeleteConfirmationModalShared, type SavedViewsSelectionContextValue, SavedViewsSelectionProvider, SavedViewsTransport, SmartGridSavedViews, getTranslations, useSavedViewsPanel, useSavedViewsSelection };
@@ -1,17 +1,20 @@
1
1
  import { Locale } from '@procore/globalization-toolkit';
2
2
  import * as React$1 from 'react';
3
- import React__default from 'react';
3
+ import React__default, { PropsWithChildren } 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 _procore_core_react_dist_Panel_Panel_types from '@procore/core-react/dist/Panel/Panel.types';
7
7
  import * as styled_components_dist_types from 'styled-components/dist/types';
8
8
  import * as _procore_core_react from '@procore/core-react';
9
+ import { S as SavedViewsTransport } from './types-BWhJ-on3.js';
10
+ export { a as SavedViewsCacheControl, b as SavedViewsHttpRequest, c as SavedViewsMutationArgs, d as SavedViewsMutationResult, e as SavedViewsQueryArgs, f as SavedViewsQueryResult, g as SavedViewsUrlAdapter } from './types-BWhJ-on3.js';
9
11
 
10
12
  declare function getTranslations(envLocale: Locale): Record<string, object>;
11
13
 
12
14
  declare const useSavedViewsPanel: (domain: string, tableName: string) => {
13
15
  isOpen: boolean;
14
16
  SavedViewsButton: () => React__default.JSX.Element;
17
+ SavedViewsProvider: ({ children, }: React__default.PropsWithChildren) => React__default.JSX.Element;
15
18
  };
16
19
 
17
20
  interface IQueryInputProps {
@@ -64,6 +67,15 @@ interface IBaseSavedViewsProps {
64
67
  projectId?: number;
65
68
  companyId: number;
66
69
  stickyViewsKey: string;
70
+ /**
71
+ * Optional transport that injects HTTP, query/mutation, cache, and URL
72
+ * adapters. Defaults to a transport backed by `@procore/core-http`,
73
+ * `@tanstack/react-query`, and `react-router-dom` (today's behavior).
74
+ *
75
+ * Hub Card consumers should pass the result of `createHubDataLoaderTransport`
76
+ * from `@procore/saved-views/adapters/hub-data-loader`.
77
+ */
78
+ transport?: SavedViewsTransport;
67
79
  }
68
80
  interface ISavedViewsProps extends Omit<IBaseSavedViewsProps, 'stickyViewsKey'> {
69
81
  defaultView: ISavedView;
@@ -116,6 +128,13 @@ interface IPanelContentProps {
116
128
  onClearTemporary?: () => void;
117
129
  }
118
130
 
131
+ interface SavedViewsSelectionContextValue {
132
+ selectedView: ISavedView | null;
133
+ setSelectedView: (view: ISavedView | null) => void;
134
+ }
135
+ declare const SavedViewsSelectionProvider: ({ children, }: PropsWithChildren) => React__default.JSX.Element;
136
+ declare const useSavedViewsSelection: () => SavedViewsSelectionContextValue | null;
137
+
119
138
  type SavedViewCollectionMenuItemProps = {
120
139
  item: ISavedView;
121
140
  key?: string;
@@ -158,7 +177,7 @@ declare const ExpandedPanel: styled_components_dist_types.IStyledComponentBase<"
158
177
 
159
178
  declare const PanelContent: (props: IPanelContentProps) => React__default.JSX.Element;
160
179
 
161
- declare const SavedViews: (props: ISavedViewsProps) => React__default.JSX.Element;
180
+ declare const SavedViews: (props: ISavedViewsProps) => React__default.JSX.Element | null;
162
181
 
163
182
  type Props = {
164
183
  onDelete(): void;
@@ -189,4 +208,4 @@ interface IDataTableSavedViewsRef {
189
208
  }
190
209
  declare const DataTableSavedViews: React__default.ForwardRefExoticComponent<IDataTableSavedViewsExternalConsumerProps & React__default.RefAttributes<IDataTableSavedViewsRef>>;
191
210
 
192
- export { DataTableSavedViews, ExpandedPanel, FormModal, type IDataTableDefaultViewConfig, type IDataTableSavedViewsRef, type ISmartGridDefaultViewConfig, PanelContent, SavedViewCollectionMenuItem, SavedViews, SavedViewsDeleteConfirmationModalShared, SmartGridSavedViews, getTranslations, useSavedViewsPanel };
211
+ export { DataTableSavedViews, ExpandedPanel, FormModal, type IDataTableDefaultViewConfig, type IDataTableSavedViewsRef, type ISmartGridDefaultViewConfig, PanelContent, SavedViewCollectionMenuItem, SavedViews, SavedViewsDeleteConfirmationModalShared, type SavedViewsSelectionContextValue, SavedViewsSelectionProvider, SavedViewsTransport, SmartGridSavedViews, getTranslations, useSavedViewsPanel, useSavedViewsSelection };