tp-react-elements 1.3.2 → 1.3.4

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 (48) hide show
  1. package/dist/_virtual/index.esm10.js +2 -2
  2. package/dist/_virtual/index.esm4.js +2 -2
  3. package/dist/_virtual/index.esm5.js +2 -2
  4. package/dist/_virtual/index.esm7.js +2 -2
  5. package/dist/_virtual/index.esm9.js +2 -2
  6. package/dist/components/DateRangePicker/DateRangePicker.d.ts +0 -3
  7. package/dist/components/DateRangePicker/DateRangePicker.esm.js +4 -0
  8. package/dist/components/Form/FormRender.esm.js +12 -8
  9. package/dist/components/FormComponents/Select/SearchableSelect.d.ts +6 -0
  10. package/dist/components/FormComponents/Select/SearchableSelect.esm.js +78 -0
  11. package/dist/components/FormComponents/index.d.ts +1 -0
  12. package/dist/components/FormComponents/index.esm.js +13 -26
  13. package/dist/components/PaginatedGrid/DynamicFilterBar.d.ts +33 -7
  14. package/dist/components/PaginatedGrid/DynamicFilterBar.esm.js +101 -40
  15. package/dist/components/PaginatedGrid/GenericPaginatedGrid.d.ts +10 -3
  16. package/dist/components/PaginatedGrid/GenericPaginatedGrid.esm.js +49 -5
  17. package/dist/components/PaginatedGrid/columns.d.ts +2 -2
  18. package/dist/components/PaginatedGrid/types.d.ts +61 -0
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.esm.css +1 -1
  21. package/dist/index.esm.js +1 -0
  22. package/dist/node_modules/prop-types/index.esm.js +1 -1
  23. package/dist/node_modules/react-date-range/dist/accessibility/index.esm.js +1 -1
  24. package/dist/node_modules/react-date-range/dist/components/Calendar/index.esm.js +1 -1
  25. package/dist/node_modules/react-date-range/dist/components/DateRange/index.esm.js +1 -1
  26. package/dist/node_modules/react-date-range/dist/components/DefinedRange/index.esm.js +1 -1
  27. package/dist/utils/Interface/FormInterface.d.ts +1 -1
  28. package/dist/utils/rdrStyles.d.ts +12 -0
  29. package/dist/utils/rdrStyles.esm.js +180 -0
  30. package/package.json +5 -1
  31. package/dist/node_modules/@tanstack/query-core/build/modern/environmentManager.esm.js +0 -22
  32. package/dist/node_modules/@tanstack/query-core/build/modern/focusManager.esm.js +0 -65
  33. package/dist/node_modules/@tanstack/query-core/build/modern/notifyManager.esm.js +0 -83
  34. package/dist/node_modules/@tanstack/query-core/build/modern/onlineManager.esm.js +0 -55
  35. package/dist/node_modules/@tanstack/query-core/build/modern/query.esm.js +0 -16
  36. package/dist/node_modules/@tanstack/query-core/build/modern/queryObserver.esm.js +0 -463
  37. package/dist/node_modules/@tanstack/query-core/build/modern/retryer.esm.js +0 -8
  38. package/dist/node_modules/@tanstack/query-core/build/modern/subscribable.esm.js +0 -24
  39. package/dist/node_modules/@tanstack/query-core/build/modern/thenable.esm.js +0 -34
  40. package/dist/node_modules/@tanstack/query-core/build/modern/timeoutManager.esm.js +0 -66
  41. package/dist/node_modules/@tanstack/query-core/build/modern/utils.esm.js +0 -115
  42. package/dist/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.esm.js +0 -7
  43. package/dist/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.esm.js +0 -15
  44. package/dist/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.esm.js +0 -21
  45. package/dist/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.esm.js +0 -27
  46. package/dist/node_modules/@tanstack/react-query/build/modern/suspense.esm.js +0 -22
  47. package/dist/node_modules/@tanstack/react-query/build/modern/useBaseQuery.esm.js +0 -94
  48. package/dist/node_modules/@tanstack/react-query/build/modern/useQuery.esm.js +0 -8
@@ -1,115 +0,0 @@
1
- // src/utils.ts
2
- var isServer = typeof window === "undefined" || "Deno" in globalThis;
3
- function noop() {
4
- }
5
- function isValidTimeout(value) {
6
- return typeof value === "number" && value >= 0 && value !== Infinity;
7
- }
8
- function timeUntilStale(updatedAt, staleTime) {
9
- return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);
10
- }
11
- function resolveStaleTime(staleTime, query) {
12
- return typeof staleTime === "function" ? staleTime(query) : staleTime;
13
- }
14
- function resolveQueryBoolean(option, query) {
15
- return typeof option === "function" ? option(query) : option;
16
- }
17
- var hasOwn = Object.prototype.hasOwnProperty;
18
- function replaceEqualDeep(a, b, depth = 0) {
19
- if (a === b) {
20
- return a;
21
- }
22
- if (depth > 500) return b;
23
- const array = isPlainArray(a) && isPlainArray(b);
24
- if (!array && !(isPlainObject(a) && isPlainObject(b))) return b;
25
- const aItems = array ? a : Object.keys(a);
26
- const aSize = aItems.length;
27
- const bItems = array ? b : Object.keys(b);
28
- const bSize = bItems.length;
29
- const copy = array ? new Array(bSize) : {};
30
- let equalItems = 0;
31
- for (let i = 0; i < bSize; i++) {
32
- const key = array ? i : bItems[i];
33
- const aItem = a[key];
34
- const bItem = b[key];
35
- if (aItem === bItem) {
36
- copy[key] = aItem;
37
- if (array ? i < aSize : hasOwn.call(a, key)) equalItems++;
38
- continue;
39
- }
40
- if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") {
41
- copy[key] = bItem;
42
- continue;
43
- }
44
- const v = replaceEqualDeep(aItem, bItem, depth + 1);
45
- copy[key] = v;
46
- if (v === aItem) equalItems++;
47
- }
48
- return aSize === bSize && equalItems === aSize ? a : copy;
49
- }
50
- function shallowEqualObjects(a, b) {
51
- if (!b || Object.keys(a).length !== Object.keys(b).length) {
52
- return false;
53
- }
54
- for (const key in a) {
55
- if (a[key] !== b[key]) {
56
- return false;
57
- }
58
- }
59
- return true;
60
- }
61
- function isPlainArray(value) {
62
- return Array.isArray(value) && value.length === Object.keys(value).length;
63
- }
64
- function isPlainObject(o) {
65
- if (!hasObjectPrototype(o)) {
66
- return false;
67
- }
68
- const ctor = o.constructor;
69
- if (ctor === void 0) {
70
- return true;
71
- }
72
- const prot = ctor.prototype;
73
- if (!hasObjectPrototype(prot)) {
74
- return false;
75
- }
76
- if (!prot.hasOwnProperty("isPrototypeOf")) {
77
- return false;
78
- }
79
- if (Object.getPrototypeOf(o) !== Object.prototype) {
80
- return false;
81
- }
82
- return true;
83
- }
84
- function hasObjectPrototype(o) {
85
- return Object.prototype.toString.call(o) === "[object Object]";
86
- }
87
- function replaceData(prevData, data, options) {
88
- if (typeof options.structuralSharing === "function") {
89
- return options.structuralSharing(prevData, data);
90
- } else if (options.structuralSharing !== false) {
91
- if (process.env.NODE_ENV !== "production") {
92
- try {
93
- return replaceEqualDeep(prevData, data);
94
- } catch (error) {
95
- console.error(
96
- `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`
97
- );
98
- throw error;
99
- }
100
- }
101
- return replaceEqualDeep(prevData, data);
102
- }
103
- return data;
104
- }
105
- function keepPreviousData(previousData) {
106
- return previousData;
107
- }
108
- function shouldThrowError(throwOnError, params) {
109
- if (typeof throwOnError === "function") {
110
- return throwOnError(...params);
111
- }
112
- return !!throwOnError;
113
- }
114
-
115
- export { isPlainArray, isPlainObject, isServer, isValidTimeout, keepPreviousData, noop, replaceData, replaceEqualDeep, resolveQueryBoolean, resolveStaleTime, shallowEqualObjects, shouldThrowError, timeUntilStale };
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
-
3
- var IsRestoringContext = React.createContext(false);
4
- var useIsRestoring = () => React.useContext(IsRestoringContext);
5
- IsRestoringContext.Provider;
6
-
7
- export { useIsRestoring };
@@ -1,15 +0,0 @@
1
- import * as React from 'react';
2
- import 'react/jsx-runtime';
3
-
4
- var QueryClientContext = React.createContext(
5
- void 0
6
- );
7
- var useQueryClient = (queryClient) => {
8
- const client = React.useContext(QueryClientContext);
9
- if (!client) {
10
- throw new Error("No QueryClient set, use QueryClientProvider to set one");
11
- }
12
- return client;
13
- };
14
-
15
- export { QueryClientContext, useQueryClient };
@@ -1,21 +0,0 @@
1
- import * as React from 'react';
2
- import 'react/jsx-runtime';
3
-
4
- function createValue() {
5
- let isReset = false;
6
- return {
7
- clearReset: () => {
8
- isReset = false;
9
- },
10
- reset: () => {
11
- isReset = true;
12
- },
13
- isReset: () => {
14
- return isReset;
15
- }
16
- };
17
- }
18
- var QueryErrorResetBoundaryContext = React.createContext(createValue());
19
- var useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext);
20
-
21
- export { useQueryErrorResetBoundary };
@@ -1,27 +0,0 @@
1
- import * as React from 'react';
2
- import { shouldThrowError } from '../../../query-core/build/modern/utils.esm.js';
3
-
4
- var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => {
5
- const throwOnError = query?.state.error && typeof options.throwOnError === "function" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError;
6
- if (options.suspense || options.experimental_prefetchInRender || throwOnError) {
7
- if (!errorResetBoundary.isReset()) {
8
- options.retryOnMount = false;
9
- }
10
- }
11
- };
12
- var useClearResetErrorBoundary = (errorResetBoundary) => {
13
- React.useEffect(() => {
14
- errorResetBoundary.clearReset();
15
- }, [errorResetBoundary]);
16
- };
17
- var getHasError = ({
18
- result,
19
- errorResetBoundary,
20
- throwOnError,
21
- query,
22
- suspense
23
- }) => {
24
- return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query]));
25
- };
26
-
27
- export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary };
@@ -1,22 +0,0 @@
1
- // src/suspense.ts
2
- var ensureSuspenseTimers = (defaultedOptions) => {
3
- if (defaultedOptions.suspense) {
4
- const MIN_SUSPENSE_TIME_MS = 1e3;
5
- const clamp = (value) => value === "static" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS);
6
- const originalStaleTime = defaultedOptions.staleTime;
7
- defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime);
8
- if (typeof defaultedOptions.gcTime === "number") {
9
- defaultedOptions.gcTime = Math.max(
10
- defaultedOptions.gcTime,
11
- MIN_SUSPENSE_TIME_MS
12
- );
13
- }
14
- }
15
- };
16
- var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;
17
- var shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending;
18
- var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {
19
- errorResetBoundary.clearReset();
20
- });
21
-
22
- export { ensureSuspenseTimers, fetchOptimistic, shouldSuspend, willFetch };
@@ -1,94 +0,0 @@
1
- import * as React from 'react';
2
- import { environmentManager } from '../../../query-core/build/modern/environmentManager.esm.js';
3
- import { notifyManager } from '../../../query-core/build/modern/notifyManager.esm.js';
4
- import { noop } from '../../../query-core/build/modern/utils.esm.js';
5
- import { useQueryClient } from './QueryClientProvider.esm.js';
6
- import { useQueryErrorResetBoundary } from './QueryErrorResetBoundary.esm.js';
7
- import { ensurePreventErrorBoundaryRetry, useClearResetErrorBoundary, getHasError } from './errorBoundaryUtils.esm.js';
8
- import { useIsRestoring } from './IsRestoringProvider.esm.js';
9
- import { ensureSuspenseTimers, shouldSuspend, fetchOptimistic, willFetch } from './suspense.esm.js';
10
-
11
- function useBaseQuery(options, Observer, queryClient) {
12
- if (process.env.NODE_ENV !== "production") {
13
- if (typeof options !== "object" || Array.isArray(options)) {
14
- throw new Error(
15
- 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
16
- );
17
- }
18
- }
19
- const isRestoring = useIsRestoring();
20
- const errorResetBoundary = useQueryErrorResetBoundary();
21
- const client = useQueryClient();
22
- const defaultedOptions = client.defaultQueryOptions(options);
23
- client.getDefaultOptions().queries?._experimental_beforeQuery?.(
24
- defaultedOptions
25
- );
26
- const query = client.getQueryCache().get(defaultedOptions.queryHash);
27
- if (process.env.NODE_ENV !== "production") {
28
- if (!defaultedOptions.queryFn) {
29
- console.error(
30
- `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
31
- );
32
- }
33
- }
34
- const subscribed = options.subscribed !== false;
35
- defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : subscribed ? "optimistic" : void 0;
36
- ensureSuspenseTimers(defaultedOptions);
37
- ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query);
38
- useClearResetErrorBoundary(errorResetBoundary);
39
- const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash);
40
- const [observer] = React.useState(
41
- () => new Observer(
42
- client,
43
- defaultedOptions
44
- )
45
- );
46
- const result = observer.getOptimisticResult(defaultedOptions);
47
- const shouldSubscribe = !isRestoring && subscribed;
48
- React.useSyncExternalStore(
49
- React.useCallback(
50
- (onStoreChange) => {
51
- const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop;
52
- observer.updateResult();
53
- return unsubscribe;
54
- },
55
- [observer, shouldSubscribe]
56
- ),
57
- () => observer.getCurrentResult(),
58
- () => observer.getCurrentResult()
59
- );
60
- React.useEffect(() => {
61
- observer.setOptions(defaultedOptions);
62
- }, [defaultedOptions, observer]);
63
- if (shouldSuspend(defaultedOptions, result)) {
64
- throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);
65
- }
66
- if (getHasError({
67
- result,
68
- errorResetBoundary,
69
- throwOnError: defaultedOptions.throwOnError,
70
- query,
71
- suspense: defaultedOptions.suspense
72
- })) {
73
- throw result.error;
74
- }
75
- client.getDefaultOptions().queries?._experimental_afterQuery?.(
76
- defaultedOptions,
77
- result
78
- );
79
- if (defaultedOptions.experimental_prefetchInRender && !environmentManager.isServer() && willFetch(result, isRestoring)) {
80
- const promise = isNewCacheEntry ? (
81
- // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
82
- fetchOptimistic(defaultedOptions, observer, errorResetBoundary)
83
- ) : (
84
- // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
85
- query?.promise
86
- );
87
- promise?.catch(noop).finally(() => {
88
- observer.updateResult();
89
- });
90
- }
91
- return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;
92
- }
93
-
94
- export { useBaseQuery };
@@ -1,8 +0,0 @@
1
- import { QueryObserver } from '../../../query-core/build/modern/queryObserver.esm.js';
2
- import { useBaseQuery } from './useBaseQuery.esm.js';
3
-
4
- function useQuery(options, queryClient) {
5
- return useBaseQuery(options, QueryObserver);
6
- }
7
-
8
- export { useQuery };