@arrai-innovations/reactive-helpers 20.1.2 → 21.0.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/README.md +22 -893
- package/config/listCrud.js +30 -27
- package/config/objectCrud.js +20 -13
- package/index.js +5 -3
- package/package.json +5 -3
- package/types/config/commonCrud.d.ts +0 -1
- package/types/config/listCrud.d.ts +28 -41
- package/types/config/objectCrud.d.ts +14 -29
- package/types/index.d.ts +5 -4
- package/types/tests/unit/config/listCrud.spec.d.ts +0 -1
- package/types/tests/unit/config/objectCrud.spec.d.ts +0 -1
- package/types/tests/unit/crudPromise.d.ts +42 -15
- package/types/tests/unit/mockOnUnmounted.d.ts +0 -1
- package/types/tests/unit/poll.d.ts +0 -1
- package/types/tests/unit/scopedIt.d.ts +15 -0
- package/types/tests/unit/setup.d.ts +2 -0
- package/types/tests/unit/use/cancellableIntent.spec.d.ts +0 -1
- package/types/tests/unit/use/combineClasses.spec.d.ts +1 -0
- package/types/tests/unit/use/list.spec.d.ts +1 -0
- package/types/tests/unit/use/listCalculated.spec.d.ts +0 -1
- package/types/tests/unit/use/listFilter.spec.d.ts +0 -1
- package/types/tests/unit/use/listInstance.spec.d.ts +0 -1
- package/types/tests/unit/use/listRelated.spec.d.ts +0 -1
- package/types/tests/unit/use/listSearch.spec.d.ts +0 -1
- package/types/tests/unit/use/listSort.spec.d.ts +0 -1
- package/types/tests/unit/use/listSubscription.spec.d.ts +0 -1
- package/types/tests/unit/use/loadingError.spec.d.ts +0 -1
- package/types/tests/unit/use/object.spec.d.ts +1 -0
- package/types/tests/unit/use/objectCalculated.spec.d.ts +1 -0
- package/types/tests/unit/use/objectInstance.spec.d.ts +0 -1
- package/types/tests/unit/use/objectRelated.spec.d.ts +1 -0
- package/types/tests/unit/use/objectSubscription.spec.d.ts +0 -1
- package/types/tests/unit/use/proxyLoadingError.spec.d.ts +0 -1
- package/types/tests/unit/use/search.error.spec.d.ts +1 -0
- package/types/tests/unit/use/search.spec.d.ts +0 -1
- package/types/tests/unit/utils/assignReactiveObject.extra.spec.d.ts +1 -0
- package/types/tests/unit/utils/assignReactiveObject.refs.spec.d.ts +1 -0
- package/types/tests/unit/utils/assignReactiveObject.spec.d.ts +0 -1
- package/types/tests/unit/utils/cancellableFetch.spec.d.ts +1 -0
- package/types/tests/unit/utils/classes.spec.d.ts +0 -1
- package/types/tests/unit/utils/compact.spec.d.ts +1 -0
- package/types/tests/unit/utils/deepUnref.spec.d.ts +1 -0
- package/types/tests/unit/utils/deleteKey.spec.d.ts +0 -1
- package/types/tests/unit/utils/flattenPaths.spec.d.ts +0 -1
- package/types/tests/unit/utils/flattenPathsWithValues.spec.d.ts +1 -0
- package/types/tests/unit/utils/getFakePk.spec.d.ts +1 -0
- package/types/tests/unit/utils/keepAliveTry.spec.d.ts +1 -0
- package/types/tests/unit/utils/keyDiff.spec.d.ts +0 -1
- package/types/tests/unit/utils/set.spec.d.ts +0 -1
- package/types/tests/unit/utils/transformWalk.spec.d.ts +1 -0
- package/types/tests/unit/utils/unwrapNested.spec.d.ts +1 -0
- package/types/tests/unit/utils/watches.spec.d.ts +0 -1
- package/types/use/cancellableIntent.d.ts +121 -48
- package/types/use/combineClasses.d.ts +0 -1
- package/types/use/error.d.ts +48 -0
- package/types/use/list.d.ts +9 -32
- package/types/use/listCalculated.d.ts +107 -49
- package/types/use/listFilter.d.ts +13 -31
- package/types/use/listInstance.d.ts +137 -71
- package/types/use/listRelated.d.ts +106 -43
- package/types/use/listSearch.d.ts +24 -12
- package/types/use/listSort.d.ts +3 -34
- package/types/use/listSubscription.d.ts +40 -57
- package/types/use/loading.d.ts +37 -0
- package/types/use/loadingError.d.ts +5 -100
- package/types/use/object.d.ts +3 -12
- package/types/use/objectCalculated.d.ts +3 -9
- package/types/use/objectInstance.d.ts +59 -47
- package/types/use/objectRelated.d.ts +3 -9
- package/types/use/objectSubscription.d.ts +33 -51
- package/types/use/proxyError.d.ts +27 -0
- package/types/use/proxyLoading.d.ts +15 -0
- package/types/use/proxyLoadingError.d.ts +8 -16
- package/types/use/search.d.ts +2 -3
- package/types/utils/assignReactiveObject.d.ts +0 -1
- package/types/utils/cancellableFetch.d.ts +0 -1
- package/types/utils/cancellablePromise.d.ts +0 -1
- package/types/utils/classes.d.ts +2 -8
- package/types/utils/compact.d.ts +0 -1
- package/types/utils/deepUnref.d.ts +2 -23
- package/types/utils/deleteKey.d.ts +6 -6
- package/types/utils/flattenPaths.d.ts +0 -1
- package/types/utils/flattenPathsWithValues.d.ts +29 -0
- package/types/utils/getFakePk.d.ts +0 -1
- package/types/utils/keepAliveTry.d.ts +0 -1
- package/types/utils/keyDiff.d.ts +9 -10
- package/types/utils/loadingCombine.d.ts +0 -1
- package/types/utils/proxyRunning.d.ts +2 -3
- package/types/utils/refIfReactive.d.ts +0 -1
- package/types/utils/relatedCalculatedHelpers.d.ts +0 -1
- package/types/utils/set.d.ts +0 -1
- package/types/utils/transformWalk.d.ts +0 -1
- package/types/utils/unwrapNested.d.ts +0 -1
- package/types/utils/watches.d.ts +0 -1
- package/use/cancellableIntent.js +185 -100
- package/use/error.js +44 -0
- package/use/list.js +51 -111
- package/use/listCalculated.js +75 -98
- package/use/listFilter.js +91 -186
- package/use/listInstance.js +357 -282
- package/use/listRelated.js +52 -72
- package/use/listSearch.js +49 -86
- package/use/listSort.js +121 -237
- package/use/listSubscription.js +181 -274
- package/use/loading.js +35 -0
- package/use/loadingError.js +7 -81
- package/use/object.js +47 -67
- package/use/objectCalculated.js +103 -65
- package/use/objectInstance.js +253 -241
- package/use/objectRelated.js +48 -30
- package/use/objectSubscription.js +110 -175
- package/use/proxyError.js +48 -0
- package/use/proxyLoading.js +22 -0
- package/use/proxyLoadingError.js +9 -35
- package/use/search.js +4 -2
- package/utils/assignReactiveObject.js +8 -8
- package/utils/classes.js +7 -28
- package/utils/deepUnref.js +15 -2
- package/utils/deleteKey.js +13 -5
- package/utils/flattenPathsWithValues.js +65 -0
- package/utils/keyDiff.js +5 -5
- package/utils/proxyRunning.js +16 -10
- package/types/config/commonCrud.d.ts.map +0 -1
- package/types/config/listCrud.d.ts.map +0 -1
- package/types/config/objectCrud.d.ts.map +0 -1
- package/types/index.d.ts.map +0 -1
- package/types/tests/unit/config/listCrud.spec.d.ts.map +0 -1
- package/types/tests/unit/config/objectCrud.spec.d.ts.map +0 -1
- package/types/tests/unit/crudPromise.d.ts.map +0 -1
- package/types/tests/unit/expectHelpers.d.ts +0 -2
- package/types/tests/unit/expectHelpers.d.ts.map +0 -1
- package/types/tests/unit/mockOnUnmounted.d.ts.map +0 -1
- package/types/tests/unit/poll.d.ts.map +0 -1
- package/types/tests/unit/use/cancellableIntent.spec.d.ts.map +0 -1
- package/types/tests/unit/use/listCalculated.spec.d.ts.map +0 -1
- package/types/tests/unit/use/listFilter.spec.d.ts.map +0 -1
- package/types/tests/unit/use/listInstance.spec.d.ts.map +0 -1
- package/types/tests/unit/use/listRelated.spec.d.ts.map +0 -1
- package/types/tests/unit/use/listSearch.spec.d.ts.map +0 -1
- package/types/tests/unit/use/listSort.spec.d.ts.map +0 -1
- package/types/tests/unit/use/listSubscription.spec.d.ts.map +0 -1
- package/types/tests/unit/use/loadingError.spec.d.ts.map +0 -1
- package/types/tests/unit/use/objectInstance.spec.d.ts.map +0 -1
- package/types/tests/unit/use/objectSubscription.spec.d.ts.map +0 -1
- package/types/tests/unit/use/proxyLoadingError.spec.d.ts.map +0 -1
- package/types/tests/unit/use/search.spec.d.ts.map +0 -1
- package/types/tests/unit/utils/assignReactiveObject.spec.d.ts.map +0 -1
- package/types/tests/unit/utils/classes.spec.d.ts.map +0 -1
- package/types/tests/unit/utils/deleteKey.spec.d.ts.map +0 -1
- package/types/tests/unit/utils/flattenPaths.spec.d.ts.map +0 -1
- package/types/tests/unit/utils/keyDiff.spec.d.ts.map +0 -1
- package/types/tests/unit/utils/set.spec.d.ts.map +0 -1
- package/types/tests/unit/utils/watches.spec.d.ts.map +0 -1
- package/types/use/cancellableIntent.d.ts.map +0 -1
- package/types/use/combineClasses.d.ts.map +0 -1
- package/types/use/list.d.ts.map +0 -1
- package/types/use/listCalculated.d.ts.map +0 -1
- package/types/use/listFilter.d.ts.map +0 -1
- package/types/use/listInstance.d.ts.map +0 -1
- package/types/use/listKeys.d.ts +0 -15
- package/types/use/listKeys.d.ts.map +0 -1
- package/types/use/listRelated.d.ts.map +0 -1
- package/types/use/listSearch.d.ts.map +0 -1
- package/types/use/listSort.d.ts.map +0 -1
- package/types/use/listSubscription.d.ts.map +0 -1
- package/types/use/loadingError.d.ts.map +0 -1
- package/types/use/object.d.ts.map +0 -1
- package/types/use/objectCalculated.d.ts.map +0 -1
- package/types/use/objectInstance.d.ts.map +0 -1
- package/types/use/objectRelated.d.ts.map +0 -1
- package/types/use/objectSubscription.d.ts.map +0 -1
- package/types/use/paginatedListInstance.d.ts +0 -60
- package/types/use/paginatedListInstance.d.ts.map +0 -1
- package/types/use/proxyLoadingError.d.ts.map +0 -1
- package/types/use/search.d.ts.map +0 -1
- package/types/use/watchesRunning.d.ts +0 -63
- package/types/use/watchesRunning.d.ts.map +0 -1
- package/types/utils/assignReactiveObject.d.ts.map +0 -1
- package/types/utils/cancellableFetch.d.ts.map +0 -1
- package/types/utils/cancellablePromise.d.ts.map +0 -1
- package/types/utils/classes.d.ts.map +0 -1
- package/types/utils/compact.d.ts.map +0 -1
- package/types/utils/deepUnref.d.ts.map +0 -1
- package/types/utils/deleteKey.d.ts.map +0 -1
- package/types/utils/flattenPaths.d.ts.map +0 -1
- package/types/utils/getFakePk.d.ts.map +0 -1
- package/types/utils/keepAliveTry.d.ts.map +0 -1
- package/types/utils/keyDiff.d.ts.map +0 -1
- package/types/utils/loadingCombine.d.ts.map +0 -1
- package/types/utils/proxyRunning.d.ts.map +0 -1
- package/types/utils/refIfReactive.d.ts.map +0 -1
- package/types/utils/relatedCalculatedHelpers.d.ts.map +0 -1
- package/types/utils/set.d.ts.map +0 -1
- package/types/utils/transformWalk.d.ts.map +0 -1
- package/types/utils/unwrapNested.d.ts.map +0 -1
- package/types/utils/watches.d.ts.map +0 -1
- package/use/listKeys.js +0 -105
- package/use/paginatedListInstance.js +0 -126
- package/use/watchesRunning.js +0 -69
|
@@ -1,9 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module provides a Vue Composition API composable function for dynamically calculating properties in lists
|
|
3
|
+
* based on complex business logic. It integrates with list management systems to apply user-defined rules
|
|
4
|
+
* that calculate new properties based on changes in list items or related data. This is particularly useful for
|
|
5
|
+
* applications that need to display derived data without altering the original source objects in the list.
|
|
6
|
+
*
|
|
7
|
+
* @module use/listCalculated.js
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Defines rules for dynamically calculating new properties for objects in a list. Each rule is a function that takes an
|
|
11
|
+
* object from the list, optionally its related objects, and previously calculated properties to compute a new
|
|
12
|
+
* property. These functions are reactive and re-evaluate when underlying dependencies change.
|
|
13
|
+
*
|
|
14
|
+
* @typedef {{
|
|
15
|
+
* [rule: string]: (
|
|
16
|
+
* object: import('../use/objectInstance.js').ExistingCrudObject,
|
|
17
|
+
* relatedObject: {
|
|
18
|
+
* [rule: string]: any,
|
|
19
|
+
* },
|
|
20
|
+
* calculatedObjects: {
|
|
21
|
+
* [rule: string]: import('vue').ComputedRef<any>,
|
|
22
|
+
* }
|
|
23
|
+
* ) => any,
|
|
24
|
+
* }} ListCalculatedRules
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* The raw state for a list calculated.
|
|
28
|
+
*
|
|
29
|
+
* @typedef {object} ListCalculatedRawState - The raw state for a list calculated property.
|
|
30
|
+
* @property {{[pk: string]: {[rule: string]: import('vue').ComputedRef<any>}}} calculatedObjects - The calculated objects.
|
|
31
|
+
* @property {ListCalculatedRules} calculatedObjectsRules - The rules for the calculated objects.
|
|
32
|
+
* @property {boolean} calculatedObjectsParentStateObjectsWatchRunning - Whether the parent state objects watch is running.
|
|
33
|
+
* @property {boolean} calculatedObjectsWatchRunning - Whether the calculated objects watch is running.
|
|
34
|
+
* @property {import('vue').ComputedRef<boolean>} calculatedRunning - Whether the calculated properties are running.
|
|
35
|
+
* @property {import('vue').ComputedRef<boolean>} running - Whether the list is running.
|
|
36
|
+
* @private
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* The raw parent state for a list calculated.
|
|
40
|
+
*
|
|
41
|
+
* @typedef {(
|
|
42
|
+
* import('./listInstance.js').ListInstanceRawState &
|
|
43
|
+
* Partial<import('./listSubscription.js').ListSubscriptionRawState> &
|
|
44
|
+
* Partial<import('./listRelated.js').ListRelatedRawState>
|
|
45
|
+
* )} ListCalculatedParentRawState
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* The state for a list calculated property.
|
|
49
|
+
*
|
|
50
|
+
* @typedef {import('vue').UnwrapNestedRefs<
|
|
51
|
+
* ListCalculatedParentRawState &
|
|
52
|
+
* ListCalculatedRawState
|
|
53
|
+
* >} ListCalculatedState
|
|
54
|
+
*/
|
|
55
|
+
/**
|
|
56
|
+
* Represents a combined reactive state that includes properties from list related,
|
|
57
|
+
* subscription, and instance modules.
|
|
58
|
+
*
|
|
59
|
+
* @typedef {import('vue').UnwrapNestedRefs<(
|
|
60
|
+
* import('./listInstance.js').ListInstanceRawState &
|
|
61
|
+
* Partial<import('./listSubscription.js').ListSubscriptionRawState> &
|
|
62
|
+
* Partial<import('./listRelated.js').ListRelatedRawState>
|
|
63
|
+
* )>} ListCalculatedParentState
|
|
64
|
+
*/
|
|
1
65
|
/**
|
|
2
66
|
* The options to create a list calculated composition function.
|
|
3
67
|
*
|
|
4
68
|
* @typedef {object} ListCalculatedOptions - Options to configure the behavior of the list calculated properties.
|
|
5
69
|
* @property {ListCalculatedParentState} parentState - The parent state that interacts with the calculated objects.
|
|
6
|
-
* @property {ListCalculatedRules} calculatedObjectsRules - A reactive reference to rules used for dynamic calculations
|
|
70
|
+
* @property {import('vue').Ref<ListCalculatedRules>} calculatedObjectsRules - A reactive reference to rules used for dynamic calculations
|
|
7
71
|
* within list objects. Proper setup of this reference ensures that updates are managed reactively, including deep
|
|
8
72
|
* property changes.
|
|
9
73
|
*/
|
|
@@ -13,8 +77,7 @@
|
|
|
13
77
|
* @typedef {object} ListCalculatedProperties
|
|
14
78
|
* @property {ListCalculatedState} state - The state for the list calculated property.
|
|
15
79
|
* @property {ListCalculatedParentState} parentState - The parent state object.
|
|
16
|
-
* @property {
|
|
17
|
-
* @property {import('vue').EffectScope} effectScope - The effect scope for the list calculated property.
|
|
80
|
+
* @property {() => void} stop - Stops composition's effects and cleans up resources.
|
|
18
81
|
*/
|
|
19
82
|
/**
|
|
20
83
|
* The instance of `useListCalculated`.
|
|
@@ -90,58 +153,18 @@ export function useListCalculateds(listCalculatedArgs: {
|
|
|
90
153
|
* list, facilitating real-time updates and complex dependency management across multiple components.
|
|
91
154
|
*/
|
|
92
155
|
export function useListCalculated({ parentState, calculatedObjectsRules }: ListCalculatedOptions): ListCalculated;
|
|
93
|
-
/**
|
|
94
|
-
* - Options to configure the behavior of the list calculated properties.
|
|
95
|
-
*/
|
|
96
|
-
export type ListCalculatedOptions = {
|
|
97
|
-
/**
|
|
98
|
-
* - The parent state that interacts with the calculated objects.
|
|
99
|
-
*/
|
|
100
|
-
parentState: ListCalculatedParentState;
|
|
101
|
-
/**
|
|
102
|
-
* - A reactive reference to rules used for dynamic calculations
|
|
103
|
-
* within list objects. Proper setup of this reference ensures that updates are managed reactively, including deep
|
|
104
|
-
* property changes.
|
|
105
|
-
*/
|
|
106
|
-
calculatedObjectsRules: ListCalculatedRules;
|
|
107
|
-
};
|
|
108
|
-
/**
|
|
109
|
-
* The properties for the list computed composition function.
|
|
110
|
-
*/
|
|
111
|
-
export type ListCalculatedProperties = {
|
|
112
|
-
/**
|
|
113
|
-
* - The state for the list calculated property.
|
|
114
|
-
*/
|
|
115
|
-
state: ListCalculatedState;
|
|
116
|
-
/**
|
|
117
|
-
* - The parent state object.
|
|
118
|
-
*/
|
|
119
|
-
parentState: ListCalculatedParentState;
|
|
120
|
-
/**
|
|
121
|
-
* - The watches running.
|
|
122
|
-
*/
|
|
123
|
-
watchesRunning: import("./watchesRunning.js").WatchesRunning;
|
|
124
|
-
/**
|
|
125
|
-
* - The effect scope for the list calculated property.
|
|
126
|
-
*/
|
|
127
|
-
effectScope: import("vue").EffectScope;
|
|
128
|
-
};
|
|
129
|
-
/**
|
|
130
|
-
* The instance of `useListCalculated`.
|
|
131
|
-
*/
|
|
132
|
-
export type ListCalculated = ListCalculatedProperties;
|
|
133
156
|
/**
|
|
134
157
|
* Defines rules for dynamically calculating new properties for objects in a list. Each rule is a function that takes an
|
|
135
158
|
* object from the list, optionally its related objects, and previously calculated properties to compute a new
|
|
136
159
|
* property. These functions are reactive and re-evaluate when underlying dependencies change.
|
|
137
160
|
*/
|
|
138
|
-
export type ListCalculatedRules =
|
|
139
|
-
[rule: string]: (object: import("
|
|
161
|
+
export type ListCalculatedRules = {
|
|
162
|
+
[rule: string]: (object: import("../use/objectInstance.js").ExistingCrudObject, relatedObject: {
|
|
140
163
|
[rule: string]: any;
|
|
141
164
|
}, calculatedObjects: {
|
|
142
165
|
[rule: string]: import("vue").ComputedRef<any>;
|
|
143
166
|
}) => any;
|
|
144
|
-
}
|
|
167
|
+
};
|
|
145
168
|
/**
|
|
146
169
|
* - The raw state for a list calculated property.
|
|
147
170
|
*/
|
|
@@ -169,11 +192,11 @@ export type ListCalculatedRawState = {
|
|
|
169
192
|
/**
|
|
170
193
|
* - Whether the calculated properties are running.
|
|
171
194
|
*/
|
|
172
|
-
calculatedRunning: boolean
|
|
195
|
+
calculatedRunning: import("vue").ComputedRef<boolean>;
|
|
173
196
|
/**
|
|
174
197
|
* - Whether the list is running.
|
|
175
198
|
*/
|
|
176
|
-
running: import("vue").
|
|
199
|
+
running: import("vue").ComputedRef<boolean>;
|
|
177
200
|
};
|
|
178
201
|
/**
|
|
179
202
|
* The raw parent state for a list calculated.
|
|
@@ -188,4 +211,39 @@ export type ListCalculatedState = import("vue").UnwrapNestedRefs<ListCalculatedP
|
|
|
188
211
|
* subscription, and instance modules.
|
|
189
212
|
*/
|
|
190
213
|
export type ListCalculatedParentState = import("vue").UnwrapNestedRefs<(import("./listInstance.js").ListInstanceRawState & Partial<import("./listSubscription.js").ListSubscriptionRawState> & Partial<import("./listRelated.js").ListRelatedRawState>)>;
|
|
191
|
-
|
|
214
|
+
/**
|
|
215
|
+
* - Options to configure the behavior of the list calculated properties.
|
|
216
|
+
*/
|
|
217
|
+
export type ListCalculatedOptions = {
|
|
218
|
+
/**
|
|
219
|
+
* - The parent state that interacts with the calculated objects.
|
|
220
|
+
*/
|
|
221
|
+
parentState: ListCalculatedParentState;
|
|
222
|
+
/**
|
|
223
|
+
* - A reactive reference to rules used for dynamic calculations
|
|
224
|
+
* within list objects. Proper setup of this reference ensures that updates are managed reactively, including deep
|
|
225
|
+
* property changes.
|
|
226
|
+
*/
|
|
227
|
+
calculatedObjectsRules: import("vue").Ref<ListCalculatedRules>;
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* The properties for the list computed composition function.
|
|
231
|
+
*/
|
|
232
|
+
export type ListCalculatedProperties = {
|
|
233
|
+
/**
|
|
234
|
+
* - The state for the list calculated property.
|
|
235
|
+
*/
|
|
236
|
+
state: ListCalculatedState;
|
|
237
|
+
/**
|
|
238
|
+
* - The parent state object.
|
|
239
|
+
*/
|
|
240
|
+
parentState: ListCalculatedParentState;
|
|
241
|
+
/**
|
|
242
|
+
* - Stops composition's effects and cleans up resources.
|
|
243
|
+
*/
|
|
244
|
+
stop: () => void;
|
|
245
|
+
};
|
|
246
|
+
/**
|
|
247
|
+
* The instance of `useListCalculated`.
|
|
248
|
+
*/
|
|
249
|
+
export type ListCalculated = ListCalculatedProperties;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Provides reactive filtering functionality for lists within a Vue application. This composable
|
|
3
|
+
* supports defining dynamic inclusion and exclusion criteria to control the visibility of list items
|
|
4
|
+
* based on user-defined rules. It's particularly useful in scenarios where list contents need to be
|
|
5
|
+
* dynamically adjusted without modifying the source data.
|
|
6
|
+
*
|
|
7
|
+
* @module use/listFilter.js
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {import('vue').Ref<import('../use/objectInstance.js').ExistingCrudObject>[]} ObjectsInOrderRefs
|
|
3
11
|
*/
|
|
4
12
|
/**
|
|
5
13
|
* @typedef {Function} ListFilterAllowedFilter - A function that returns true if an item should be included.
|
|
@@ -14,11 +22,6 @@
|
|
|
14
22
|
* @typedef {object} ListFilterRawState
|
|
15
23
|
* @property {ListFilterAllowedFilter} [allowedFilter] - Function to determine if an item should be included based on custom logic.
|
|
16
24
|
* @property {ListFilterExcludedFilter} [excludedFilter] - Function to determine if an item should be excluded based on custom logic.
|
|
17
|
-
* @property {object} inResults - A map of items to boolean values indicating filter results.
|
|
18
|
-
* @property {boolean} objectsWatchRunning - Flag indicating if the object watch is active.
|
|
19
|
-
* @property {boolean} resultsWatchRunning - Flag indicating if the results watch is active.
|
|
20
|
-
* @property {boolean} running - Flag indicating if any part of the filter logic is currently processing.
|
|
21
|
-
* @property {boolean} orderWatchRunning - Flag indicating if the order watch is active.
|
|
22
25
|
*/
|
|
23
26
|
/**
|
|
24
27
|
*
|
|
@@ -59,7 +62,7 @@
|
|
|
59
62
|
* @typedef {object} ListFilterProperties
|
|
60
63
|
* @property {ListFilterState} state - The reactive state managing the filter logic and results.
|
|
61
64
|
* @property {ListFilterParentState} parentState - The state of the list being filtered.
|
|
62
|
-
* @property {
|
|
65
|
+
* @property {() => void} stop - A function to stop the effect scope and clean up resources.
|
|
63
66
|
*/
|
|
64
67
|
/**
|
|
65
68
|
* Represents an instance of a list filter, including its state and associated Vue composition API utilities.
|
|
@@ -110,7 +113,7 @@ export function useListFilters(listFilterArgs: {
|
|
|
110
113
|
* @returns {ListFilter} A fully configured list filter instance, providing reactive filtered results.
|
|
111
114
|
*/
|
|
112
115
|
export function useListFilter({ parentState, allowedFilter, excludedFilter }: ListFilterOptions): ListFilter;
|
|
113
|
-
export type ObjectsInOrderRefs = import("vue").Ref<import("
|
|
116
|
+
export type ObjectsInOrderRefs = import("vue").Ref<import("../use/objectInstance.js").ExistingCrudObject>[];
|
|
114
117
|
/**
|
|
115
118
|
* - A function that returns true if an item should be included.
|
|
116
119
|
*/
|
|
@@ -132,26 +135,6 @@ export type ListFilterRawState = {
|
|
|
132
135
|
* - Function to determine if an item should be excluded based on custom logic.
|
|
133
136
|
*/
|
|
134
137
|
excludedFilter?: ListFilterExcludedFilter;
|
|
135
|
-
/**
|
|
136
|
-
* - A map of items to boolean values indicating filter results.
|
|
137
|
-
*/
|
|
138
|
-
inResults: object;
|
|
139
|
-
/**
|
|
140
|
-
* - Flag indicating if the object watch is active.
|
|
141
|
-
*/
|
|
142
|
-
objectsWatchRunning: boolean;
|
|
143
|
-
/**
|
|
144
|
-
* - Flag indicating if the results watch is active.
|
|
145
|
-
*/
|
|
146
|
-
resultsWatchRunning: boolean;
|
|
147
|
-
/**
|
|
148
|
-
* - Flag indicating if any part of the filter logic is currently processing.
|
|
149
|
-
*/
|
|
150
|
-
running: boolean;
|
|
151
|
-
/**
|
|
152
|
-
* - Flag indicating if the order watch is active.
|
|
153
|
-
*/
|
|
154
|
-
orderWatchRunning: boolean;
|
|
155
138
|
};
|
|
156
139
|
export type ListFilterParentRawState = (import("./listInstance.js").ListInstanceRawState & Partial<import("./listSubscription.js").ListSubscriptionRawState> & Partial<import("./listRelated.js").ListRelatedRawState> & Partial<import("./listCalculated.js").ListCalculatedRawState>);
|
|
157
140
|
/**
|
|
@@ -192,12 +175,11 @@ export type ListFilterProperties = {
|
|
|
192
175
|
*/
|
|
193
176
|
parentState: ListFilterParentState;
|
|
194
177
|
/**
|
|
195
|
-
* -
|
|
178
|
+
* - A function to stop the effect scope and clean up resources.
|
|
196
179
|
*/
|
|
197
|
-
|
|
180
|
+
stop: () => void;
|
|
198
181
|
};
|
|
199
182
|
/**
|
|
200
183
|
* Represents an instance of a list filter, including its state and associated Vue composition API utilities.
|
|
201
184
|
*/
|
|
202
185
|
export type ListFilter = ListFilterProperties;
|
|
203
|
-
//# sourceMappingURL=listFilter.d.ts.map
|
|
@@ -20,59 +20,95 @@
|
|
|
20
20
|
* function.
|
|
21
21
|
* @property {import('../config/listCrud.js').CrudListSubscribeFn} [handlers.subscribe] - Provide the implementation for the
|
|
22
22
|
* subscribe function.
|
|
23
|
-
* @property {import('vue').Ref<boolean>|boolean} keepOldPages - If true, pages will not be cleared when defaultPageCallback is called.
|
|
24
23
|
*/
|
|
25
24
|
/**
|
|
26
25
|
* The objects by pk.
|
|
27
26
|
*
|
|
28
|
-
* @typedef {{[pk: string]:
|
|
27
|
+
* @typedef {{[pk: string]: import('../use/objectInstance.js').ExistingCrudObject}} ObjectsByPk
|
|
29
28
|
*/
|
|
30
29
|
/**
|
|
31
30
|
* The objects in order, based on .order & .objects.
|
|
32
31
|
*
|
|
33
|
-
* @typedef {import('vue').ComputedRef<
|
|
32
|
+
* @typedef {import('vue').ComputedRef<import('../use/objectInstance.js').ExistingCrudObject[]>} ObjectsInOrder
|
|
34
33
|
*/
|
|
35
34
|
/**
|
|
36
35
|
* The order of the objects in the list.
|
|
37
36
|
*
|
|
38
37
|
* @typedef {import('vue').ComputedRef<string[]>} ListOrder
|
|
39
38
|
*/
|
|
39
|
+
/**
|
|
40
|
+
* @typedef {object} ListInstanceRawStateCrud
|
|
41
|
+
* @property {import('vue').Reactive<import('../config/objectCrud.js').TargetArgs|{}>} args - The arguments to be passed to the crud handlers.
|
|
42
|
+
* @property {import('../config/listCrud.js').CrudListFn} list - The list function.
|
|
43
|
+
* @property {import('../config/listCrud.js').CrudListSubscribeFn} subscribe - The subscribe function.
|
|
44
|
+
* @property {import('../config/listCrud.js').CrudBulkDeleteFn} bulkDelete - The bulk delete function.
|
|
45
|
+
* @property {import('../config/listCrud.js').CrudExecuteActionFn} executeAction - The execute action function.
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* @typedef {Map<string, import('vue').Reactive<import('../use/objectInstance.js').ExistingCrudObject>>} ObjectsMap
|
|
49
|
+
*/
|
|
50
|
+
/**
|
|
51
|
+
* @typedef {object} PaginateInfo
|
|
52
|
+
* @property {number} [totalRecords] - The total records.
|
|
53
|
+
* @property {number} [totalPages] - The total pages.
|
|
54
|
+
* @property {number} [perPage] - The per page.
|
|
55
|
+
* @property {number} [page] - The page you are giving us results for.
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* @typedef {{ [key: string]: number | string }} ColumnTotals
|
|
59
|
+
*/
|
|
40
60
|
/**
|
|
41
61
|
* The raw state object for the list instance, defining the reactive properties and their types.
|
|
42
62
|
*
|
|
43
|
-
* @typedef {object}
|
|
44
|
-
* @property {
|
|
45
|
-
* @property {object} crud.args - Arguments for the CRUD handlers.
|
|
46
|
-
* @property {Function} [crud.list] - Function to list objects.
|
|
63
|
+
* @typedef {object} ListInstanceRawMyState
|
|
64
|
+
* @property {import('vue').Reactive<ListInstanceRawStateCrud>} crud - CRUD handlers and their configurations for the list.
|
|
47
65
|
* @property {string} pkKey - The primary key field for the list objects.
|
|
48
66
|
* @property {object} params - Arguments passed to the server for listing operations.
|
|
67
|
+
* @property {ObjectsMap} objectsMap - The map of objects stored by their pks.
|
|
49
68
|
* @property {ObjectsByPk} objects - The list objects stored by their pks.
|
|
50
|
-
* @property {boolean} running - Indicates if there are ongoing reactive updates.
|
|
51
|
-
* @property {Readonly<import('vue').Ref<boolean>>} [loading] - Indicates if the list is currently loading.
|
|
52
|
-
* @property {Readonly<import('vue').Ref<boolean>>} errored - Indicates if an error occurred during the last operation.
|
|
53
|
-
* @property {Readonly<import('vue').Ref<Error|null>>} error - The last error encountered.
|
|
54
69
|
* @property {ListOrder} order - The order of objects in the list.
|
|
55
70
|
* @property {ObjectsInOrder} objectsInOrder - The objects in the order specified by the list.
|
|
71
|
+
* @property {import('vue').ShallowReactive<PaginateInfo>} paginateInfo - Pagination information for the list.
|
|
72
|
+
* @property {import('vue').ShallowReactive<ColumnTotals>} columnTotals - Column totals for the list.
|
|
73
|
+
*/
|
|
74
|
+
/**
|
|
75
|
+
* @typedef {ListInstanceRawMyState & Pick<import('./loadingError.js').LoadingErrorStatus, "loading" | "error" | "errored">} ListInstanceRawState
|
|
56
76
|
*/
|
|
57
77
|
/**
|
|
58
78
|
* Defines the reactive state used by the list instance.
|
|
59
79
|
*
|
|
60
80
|
* @typedef {import('vue').UnwrapNestedRefs<ListInstanceRawState>} ListInstanceState
|
|
61
81
|
*/
|
|
82
|
+
/**
|
|
83
|
+
* @typedef {(newObjects: import('../use/objectInstance.js').ExistingCrudObject[]) => void} PushObjectsFn
|
|
84
|
+
*/
|
|
85
|
+
/**
|
|
86
|
+
* @typedef {() => void} ClearListFn
|
|
87
|
+
*/
|
|
88
|
+
/**
|
|
89
|
+
* @typedef {(info: PaginateInfo) => void} SetPaginateInfoFn
|
|
90
|
+
*/
|
|
91
|
+
/**
|
|
92
|
+
* @typedef {(total: ColumnTotals) => void} SetColumnTotalsFn
|
|
93
|
+
*/
|
|
62
94
|
/**
|
|
63
95
|
* Defines the methods provided by the list instance for managing objects in the list.
|
|
64
96
|
*
|
|
65
|
-
* @typedef {object}
|
|
66
|
-
* @property {
|
|
67
|
-
* @property {(
|
|
68
|
-
* @property {(object:
|
|
69
|
-
* @property {(object: ListObject) => void} updateListObject - Updates an object in the list.
|
|
97
|
+
* @typedef {object} ListInstanceMyFunctions
|
|
98
|
+
* @property {PushObjectsFn} pushObjects - Customizable callback for handling new objects per page.
|
|
99
|
+
* @property {(object: import('../use/objectInstance.js').ExistingCrudObject) => void} addListObject - Adds an object to the list.
|
|
100
|
+
* @property {(object: import('../use/objectInstance.js').ExistingCrudObject) => void} updateListObject - Updates an object in the list.
|
|
70
101
|
* @property {(objectId: string) => void} deleteListObject - Deletes an object from the list by pk.
|
|
71
102
|
* @property {() => void} clearList - Clears all objects and errors from the list.
|
|
72
103
|
* @property {() => string} getFakePk - Generates a unique fake pk for use within the list.
|
|
73
104
|
* @property {() => import('../utils/cancellablePromise.js').MaybeCancellablePromise<boolean|never>} list - Initiates a fetch to retrieve objects according to the CRUD configuration, returning a promise to a boolean indicating success.
|
|
74
|
-
* @property {() => Promise<boolean>} bulkDelete -
|
|
105
|
+
* @property {(args: {pks?: string[]}) => Promise<boolean>} bulkDelete - Deletes objects from the list by pk, returning a promise to a boolean indicating success.
|
|
75
106
|
* @property {() => Promise<object|string|false>} executeAction - Initiates an action on all objects in the list, returning the response, or false if the action failed.
|
|
107
|
+
* @property {(info: PaginateInfo) => void} setPaginateInfo - The method to update pagination information.
|
|
108
|
+
* @property {(total: ColumnTotals) => void} setColumnTotals - The method to update column totals.
|
|
109
|
+
*/
|
|
110
|
+
/**
|
|
111
|
+
* @typedef {ListInstanceMyFunctions & Pick<import('./loadingError.js').LoadingErrorStatus, "clearError">} ListInstanceFunctions
|
|
76
112
|
*/
|
|
77
113
|
/**
|
|
78
114
|
* Helper type to facilitate the combination of state and functions into a single type.
|
|
@@ -145,20 +181,14 @@ export function useListInstances(listInstanceArgs: {
|
|
|
145
181
|
* @param {ListInstanceOptions} options - Specifies the configuration options for creating a list instance, including
|
|
146
182
|
* properties for CRUD operations and UI behaviors like page persistence.
|
|
147
183
|
* @returns {ListInstance} The list instance.
|
|
148
|
-
* @throws {ListInstanceError} If the props
|
|
184
|
+
* @throws {ListInstanceError} If the props are missing.
|
|
149
185
|
*/
|
|
150
|
-
export function useListInstance({ props, handlers
|
|
186
|
+
export function useListInstance({ props, handlers }: ListInstanceOptions): ListInstance;
|
|
151
187
|
/**
|
|
152
188
|
* A composable function for managing a list of objects.
|
|
153
189
|
*
|
|
154
190
|
* @module use/listInstance.js
|
|
155
191
|
*/
|
|
156
|
-
/**
|
|
157
|
-
* Defines the structure for the objects stored within the list, each identified by a unique pk and capable of
|
|
158
|
-
* holding various key-value pairs.
|
|
159
|
-
*
|
|
160
|
-
* @typedef {{pk: string, [key: string]: any}} ListObject
|
|
161
|
-
*/
|
|
162
192
|
/**
|
|
163
193
|
* Defines a custom error class specific to list instance operations, encapsulating details about errors that occur
|
|
164
194
|
* during list manipulation and processing.
|
|
@@ -207,36 +237,73 @@ export type ListInstanceOptions = {
|
|
|
207
237
|
executeAction?: import("../config/listCrud.js").CrudExecuteActionFn;
|
|
208
238
|
subscribe?: import("../config/listCrud.js").CrudListSubscribeFn;
|
|
209
239
|
};
|
|
210
|
-
/**
|
|
211
|
-
* - If true, pages will not be cleared when defaultPageCallback is called.
|
|
212
|
-
*/
|
|
213
|
-
keepOldPages: import("vue").Ref<boolean> | boolean;
|
|
214
240
|
};
|
|
215
241
|
/**
|
|
216
242
|
* The objects by pk.
|
|
217
243
|
*/
|
|
218
244
|
export type ObjectsByPk = {
|
|
219
|
-
[pk: string]:
|
|
245
|
+
[pk: string]: import("../use/objectInstance.js").ExistingCrudObject;
|
|
220
246
|
};
|
|
221
247
|
/**
|
|
222
248
|
* The objects in order, based on .order & .objects.
|
|
223
249
|
*/
|
|
224
|
-
export type ObjectsInOrder = import("vue").ComputedRef<
|
|
250
|
+
export type ObjectsInOrder = import("vue").ComputedRef<import("../use/objectInstance.js").ExistingCrudObject[]>;
|
|
225
251
|
/**
|
|
226
252
|
* The order of the objects in the list.
|
|
227
253
|
*/
|
|
228
254
|
export type ListOrder = import("vue").ComputedRef<string[]>;
|
|
255
|
+
export type ListInstanceRawStateCrud = {
|
|
256
|
+
/**
|
|
257
|
+
* - The arguments to be passed to the crud handlers.
|
|
258
|
+
*/
|
|
259
|
+
args: import("vue").Reactive<import("../config/objectCrud.js").TargetArgs | {}>;
|
|
260
|
+
/**
|
|
261
|
+
* - The list function.
|
|
262
|
+
*/
|
|
263
|
+
list: import("../config/listCrud.js").CrudListFn;
|
|
264
|
+
/**
|
|
265
|
+
* - The subscribe function.
|
|
266
|
+
*/
|
|
267
|
+
subscribe: import("../config/listCrud.js").CrudListSubscribeFn;
|
|
268
|
+
/**
|
|
269
|
+
* - The bulk delete function.
|
|
270
|
+
*/
|
|
271
|
+
bulkDelete: import("../config/listCrud.js").CrudBulkDeleteFn;
|
|
272
|
+
/**
|
|
273
|
+
* - The execute action function.
|
|
274
|
+
*/
|
|
275
|
+
executeAction: import("../config/listCrud.js").CrudExecuteActionFn;
|
|
276
|
+
};
|
|
277
|
+
export type ObjectsMap = Map<string, import("vue").Reactive<import("../use/objectInstance.js").ExistingCrudObject>>;
|
|
278
|
+
export type PaginateInfo = {
|
|
279
|
+
/**
|
|
280
|
+
* - The total records.
|
|
281
|
+
*/
|
|
282
|
+
totalRecords?: number;
|
|
283
|
+
/**
|
|
284
|
+
* - The total pages.
|
|
285
|
+
*/
|
|
286
|
+
totalPages?: number;
|
|
287
|
+
/**
|
|
288
|
+
* - The per page.
|
|
289
|
+
*/
|
|
290
|
+
perPage?: number;
|
|
291
|
+
/**
|
|
292
|
+
* - The page you are giving us results for.
|
|
293
|
+
*/
|
|
294
|
+
page?: number;
|
|
295
|
+
};
|
|
296
|
+
export type ColumnTotals = {
|
|
297
|
+
[key: string]: number | string;
|
|
298
|
+
};
|
|
229
299
|
/**
|
|
230
300
|
* The raw state object for the list instance, defining the reactive properties and their types.
|
|
231
301
|
*/
|
|
232
|
-
export type
|
|
302
|
+
export type ListInstanceRawMyState = {
|
|
233
303
|
/**
|
|
234
304
|
* - CRUD handlers and their configurations for the list.
|
|
235
305
|
*/
|
|
236
|
-
crud:
|
|
237
|
-
args: object;
|
|
238
|
-
list?: Function;
|
|
239
|
-
};
|
|
306
|
+
crud: import("vue").Reactive<ListInstanceRawStateCrud>;
|
|
240
307
|
/**
|
|
241
308
|
* - The primary key field for the list objects.
|
|
242
309
|
*/
|
|
@@ -246,25 +313,13 @@ export type ListInstanceRawState = {
|
|
|
246
313
|
*/
|
|
247
314
|
params: object;
|
|
248
315
|
/**
|
|
249
|
-
* - The
|
|
250
|
-
*/
|
|
251
|
-
objects: ObjectsByPk;
|
|
252
|
-
/**
|
|
253
|
-
* - Indicates if there are ongoing reactive updates.
|
|
254
|
-
*/
|
|
255
|
-
running: boolean;
|
|
256
|
-
/**
|
|
257
|
-
* - Indicates if the list is currently loading.
|
|
316
|
+
* - The map of objects stored by their pks.
|
|
258
317
|
*/
|
|
259
|
-
|
|
318
|
+
objectsMap: ObjectsMap;
|
|
260
319
|
/**
|
|
261
|
-
* -
|
|
262
|
-
*/
|
|
263
|
-
errored: Readonly<import("vue").Ref<boolean>>;
|
|
264
|
-
/**
|
|
265
|
-
* - The last error encountered.
|
|
320
|
+
* - The list objects stored by their pks.
|
|
266
321
|
*/
|
|
267
|
-
|
|
322
|
+
objects: ObjectsByPk;
|
|
268
323
|
/**
|
|
269
324
|
* - The order of objects in the list.
|
|
270
325
|
*/
|
|
@@ -273,31 +328,40 @@ export type ListInstanceRawState = {
|
|
|
273
328
|
* - The objects in the order specified by the list.
|
|
274
329
|
*/
|
|
275
330
|
objectsInOrder: ObjectsInOrder;
|
|
331
|
+
/**
|
|
332
|
+
* - Pagination information for the list.
|
|
333
|
+
*/
|
|
334
|
+
paginateInfo: import("vue").ShallowReactive<PaginateInfo>;
|
|
335
|
+
/**
|
|
336
|
+
* - Column totals for the list.
|
|
337
|
+
*/
|
|
338
|
+
columnTotals: import("vue").ShallowReactive<ColumnTotals>;
|
|
276
339
|
};
|
|
340
|
+
export type ListInstanceRawState = ListInstanceRawMyState & Pick<import("./loadingError.js").LoadingErrorStatus, "loading" | "error" | "errored">;
|
|
277
341
|
/**
|
|
278
342
|
* Defines the reactive state used by the list instance.
|
|
279
343
|
*/
|
|
280
344
|
export type ListInstanceState = import("vue").UnwrapNestedRefs<ListInstanceRawState>;
|
|
345
|
+
export type PushObjectsFn = (newObjects: import("../use/objectInstance.js").ExistingCrudObject[]) => void;
|
|
346
|
+
export type ClearListFn = () => void;
|
|
347
|
+
export type SetPaginateInfoFn = (info: PaginateInfo) => void;
|
|
348
|
+
export type SetColumnTotalsFn = (total: ColumnTotals) => void;
|
|
281
349
|
/**
|
|
282
350
|
* Defines the methods provided by the list instance for managing objects in the list.
|
|
283
351
|
*/
|
|
284
|
-
export type
|
|
285
|
-
/**
|
|
286
|
-
* - Handles new or updated objects, respecting the keepOldPages setting.
|
|
287
|
-
*/
|
|
288
|
-
defaultPageCallback: (newObjects: ListObject[]) => void;
|
|
352
|
+
export type ListInstanceMyFunctions = {
|
|
289
353
|
/**
|
|
290
354
|
* - Customizable callback for handling new objects per page.
|
|
291
355
|
*/
|
|
292
|
-
|
|
356
|
+
pushObjects: PushObjectsFn;
|
|
293
357
|
/**
|
|
294
358
|
* - Adds an object to the list.
|
|
295
359
|
*/
|
|
296
|
-
addListObject: (object:
|
|
360
|
+
addListObject: (object: import("../use/objectInstance.js").ExistingCrudObject) => void;
|
|
297
361
|
/**
|
|
298
362
|
* - Updates an object in the list.
|
|
299
363
|
*/
|
|
300
|
-
updateListObject: (object:
|
|
364
|
+
updateListObject: (object: import("../use/objectInstance.js").ExistingCrudObject) => void;
|
|
301
365
|
/**
|
|
302
366
|
* - Deletes an object from the list by pk.
|
|
303
367
|
*/
|
|
@@ -315,14 +379,25 @@ export type ListInstanceFunctions = {
|
|
|
315
379
|
*/
|
|
316
380
|
list: () => import("../utils/cancellablePromise.js").MaybeCancellablePromise<boolean | never>;
|
|
317
381
|
/**
|
|
318
|
-
* -
|
|
382
|
+
* - Deletes objects from the list by pk, returning a promise to a boolean indicating success.
|
|
319
383
|
*/
|
|
320
|
-
bulkDelete: (
|
|
384
|
+
bulkDelete: (args: {
|
|
385
|
+
pks?: string[];
|
|
386
|
+
}) => Promise<boolean>;
|
|
321
387
|
/**
|
|
322
388
|
* - Initiates an action on all objects in the list, returning the response, or false if the action failed.
|
|
323
389
|
*/
|
|
324
390
|
executeAction: () => Promise<object | string | false>;
|
|
391
|
+
/**
|
|
392
|
+
* - The method to update pagination information.
|
|
393
|
+
*/
|
|
394
|
+
setPaginateInfo: (info: PaginateInfo) => void;
|
|
395
|
+
/**
|
|
396
|
+
* - The method to update column totals.
|
|
397
|
+
*/
|
|
398
|
+
setColumnTotals: (total: ColumnTotals) => void;
|
|
325
399
|
};
|
|
400
|
+
export type ListInstanceFunctions = ListInstanceMyFunctions & Pick<import("./loadingError.js").LoadingErrorStatus, "clearError">;
|
|
326
401
|
/**
|
|
327
402
|
* Helper type to facilitate the combination of state and functions into a single type.
|
|
328
403
|
*/
|
|
@@ -333,12 +408,3 @@ export type ListInstanceStateMixIn = {
|
|
|
333
408
|
* The list instance, combining state management and functional operations for managing a list of objects.
|
|
334
409
|
*/
|
|
335
410
|
export type ListInstance = ListInstanceStateMixIn & ListInstanceFunctions;
|
|
336
|
-
/**
|
|
337
|
-
* Defines the structure for the objects stored within the list, each identified by a unique pk and capable of
|
|
338
|
-
* holding various key-value pairs.
|
|
339
|
-
*/
|
|
340
|
-
export type ListObject = {
|
|
341
|
-
pk: string;
|
|
342
|
-
[key: string]: any;
|
|
343
|
-
};
|
|
344
|
-
//# sourceMappingURL=listInstance.d.ts.map
|