@arrai-innovations/reactive-helpers 12.0.0 → 13.0.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/.husky/pre-commit +0 -1
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.prettierignore +1 -0
- package/README.md +11 -10
- package/config/listCrud.js +32 -1
- package/config/objectCrud.js +47 -1
- package/docs/README.md +43 -0
- package/docs/config/listCrud.md +97 -0
- package/docs/config/objectCrud.md +123 -0
- package/docs/use/cancellableIntent.md +163 -0
- package/docs/use/combineClasses.md +52 -0
- package/docs/use/list.md +285 -0
- package/docs/use/listCalculated.md +773 -0
- package/docs/use/listFilter.md +877 -0
- package/docs/use/listInstance.md +483 -0
- package/docs/use/listKeys.md +91 -0
- package/docs/use/listRelated.md +685 -0
- package/docs/use/listSearch.md +889 -0
- package/docs/use/listSort.md +1144 -0
- package/docs/use/listSubscription.md +379 -0
- package/docs/use/loadingError.md +21 -0
- package/docs/use/object.md +437 -0
- package/docs/use/objectCalculated.md +606 -0
- package/docs/use/objectInstance.md +486 -0
- package/docs/use/objectRelated.md +588 -0
- package/docs/use/objectSubscription.md +459 -0
- package/docs/use/paginatedListInstance.md +147 -0
- package/docs/use/search.md +311 -0
- package/docs/use/watchesRunning.md +80 -0
- package/docs/utils/assignReactiveObject.md +351 -0
- package/docs/utils/classes.md +100 -0
- package/docs/utils/compact.md +57 -0
- package/docs/utils/deleteKey.md +53 -0
- package/docs/utils/flattenPaths.md +45 -0
- package/docs/utils/getFakeId.md +34 -0
- package/docs/utils/keyDiff.md +101 -0
- package/docs/utils/loadingCombine.md +28 -0
- package/docs/utils/proxyRunning.md +33 -0
- package/docs/utils/relatedCalculatedHelpers.md +75 -0
- package/docs/utils/set.md +139 -0
- package/docs/utils/transformWalk.md +33 -0
- package/docs/utils/watches.md +441 -0
- package/eslint.config.js +125 -0
- package/index.js +34 -3
- package/lint-staged.config.js +5 -1
- package/makeTypeDoc.sh +25 -0
- package/package.json +27 -19
- package/tests/unit/config/listCrud.spec.js +5 -0
- package/tests/unit/config/objectCrud.spec.js +5 -0
- package/tests/unit/crudPromise.js +22 -3
- package/tests/unit/mockOnUnmounted.js +1 -1
- package/tests/unit/use/cancellableIntent.spec.js +2 -0
- package/tests/unit/use/listCalculated.spec.js +4 -3
- package/tests/unit/use/listFilter.spec.js +11 -7
- package/tests/unit/use/listInstance.spec.js +32 -14
- package/tests/unit/use/listRelated.spec.js +3 -2
- package/tests/unit/use/listSearch.spec.js +9 -7
- package/tests/unit/use/listSort.spec.js +29 -22
- package/tests/unit/use/listSubscription.spec.js +11 -5
- package/tests/unit/use/objectInstance.spec.js +15 -2
- package/tests/unit/use/objectSubscription.spec.js +31 -16
- package/tests/unit/use/search.spec.js +2 -2
- package/tests/unit/utils/assignReactiveObject.spec.js +21 -13
- package/tests/unit/utils/classes.spec.js +7 -6
- package/tests/unit/utils/watches.spec.js +4 -4
- package/tsconfig.json +19 -0
- package/typedoc-local-plugins/customize-output.js +13 -0
- package/typedoc.json +12 -0
- package/use/cancellableIntent.js +73 -2
- package/use/combineClasses.js +41 -31
- package/use/list.js +139 -5
- package/use/listCalculated.js +175 -10
- package/use/listFilter.js +175 -21
- package/use/listInstance.js +215 -94
- package/use/listRelated.js +260 -72
- package/use/listSearch.js +178 -57
- package/use/listSort.js +188 -21
- package/use/listSubscription.js +211 -63
- package/use/loadingError.js +43 -0
- package/use/object.js +187 -23
- package/use/objectCalculated.js +168 -16
- package/use/objectInstance.js +183 -102
- package/use/objectRelated.js +276 -84
- package/use/objectSubscription.js +169 -17
- package/use/paginatedListInstance.js +30 -1
- package/use/search.js +39 -23
- package/use/watchesRunning.js +41 -6
- package/utils/assignReactiveObject.js +139 -88
- package/utils/classes.js +57 -48
- package/utils/compact.js +28 -2
- package/utils/deleteKey.js +14 -1
- package/utils/flattenPaths.js +19 -9
- package/utils/getFakeId.js +11 -1
- package/utils/keyDiff.js +26 -35
- package/utils/loadingCombine.js +7 -4
- package/utils/proxyRunning.js +16 -8
- package/utils/relatedCalculatedHelpers.js +17 -0
- package/utils/set.js +66 -0
- package/utils/transformWalk.js +7 -6
- package/utils/watches.js +205 -71
- package/.eslintignore +0 -2
- package/.eslintrc.cjs +0 -25
- package/.jsdoc2md.json +0 -4
- package/config/index.js +0 -2
- package/docs.md +0 -1002
- package/jsdoc-to-markdown.sh +0 -16
- package/tests/unit/.eslintrc.cjs +0 -11
- package/tests/unit/config/index.spec.js +0 -18
- package/tests/unit/use/index.spec.js +0 -18
- package/tests/unit/utils/index.spec.js +0 -18
- package/use/index.js +0 -19
- package/utils/debugMessage.js +0 -209
- package/utils/debugWatch.js +0 -29
- package/utils/index.js +0 -16
- package/utils/lifecycleDebug.js +0 -126
package/docs/use/list.md
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
[**@arrai-innovations/reactive-helpers**](../README.md) • **Docs**
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@arrai-innovations/reactive-helpers](../README.md) / use/list
|
|
6
|
+
|
|
7
|
+
# use/list
|
|
8
|
+
|
|
9
|
+
## Interfaces
|
|
10
|
+
|
|
11
|
+
### ListManagerProperties
|
|
12
|
+
|
|
13
|
+
#### Properties
|
|
14
|
+
|
|
15
|
+
##### effectScope
|
|
16
|
+
|
|
17
|
+
> **effectScope**: `EffectScope`
|
|
18
|
+
|
|
19
|
+
Encapsulates all reactive effects related to the list hooks.
|
|
20
|
+
|
|
21
|
+
##### managed
|
|
22
|
+
|
|
23
|
+
> **managed**: [`ListManaged`](list.md#listmanaged)
|
|
24
|
+
|
|
25
|
+
A readonly reference to the managed list hooks.
|
|
26
|
+
|
|
27
|
+
##### state
|
|
28
|
+
|
|
29
|
+
> **state**: [`ListState`](list.md#liststate)
|
|
30
|
+
|
|
31
|
+
Represents the final reactive state in the list processing chain.
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### ListOptions
|
|
36
|
+
|
|
37
|
+
#### Properties
|
|
38
|
+
|
|
39
|
+
##### clearListOnListIntentTriggered
|
|
40
|
+
|
|
41
|
+
> **clearListOnListIntentTriggered**: `boolean`
|
|
42
|
+
|
|
43
|
+
Indicates whether the list should be cleared when the list intent is triggered.
|
|
44
|
+
|
|
45
|
+
##### functions
|
|
46
|
+
|
|
47
|
+
> **functions**: [`ListCrudFunctions`](../config/listCrud.md#listcrudfunctions)
|
|
48
|
+
|
|
49
|
+
Additional functions to be included in the list manager.
|
|
50
|
+
|
|
51
|
+
##### keepOldPages
|
|
52
|
+
|
|
53
|
+
> **keepOldPages**: `boolean`
|
|
54
|
+
|
|
55
|
+
Indicates whether old pages should be kept when paginating.
|
|
56
|
+
|
|
57
|
+
##### paged
|
|
58
|
+
|
|
59
|
+
> **paged**: `boolean`
|
|
60
|
+
|
|
61
|
+
Indicates whether the list should be paginated.
|
|
62
|
+
|
|
63
|
+
##### props
|
|
64
|
+
|
|
65
|
+
> **props**: [`ListRawProps`](list.md#listrawprops)
|
|
66
|
+
|
|
67
|
+
The properties for configuring the list.
|
|
68
|
+
|
|
69
|
+
##### searchShowAllWhenEmpty
|
|
70
|
+
|
|
71
|
+
> **searchShowAllWhenEmpty**: `boolean`
|
|
72
|
+
|
|
73
|
+
Indicates whether all items should be shown when the search query is empty.
|
|
74
|
+
|
|
75
|
+
##### searchThrottle
|
|
76
|
+
|
|
77
|
+
> **searchThrottle**: `number`
|
|
78
|
+
|
|
79
|
+
The throttle time for text search.
|
|
80
|
+
|
|
81
|
+
##### sortThrottleWait
|
|
82
|
+
|
|
83
|
+
> **sortThrottleWait**: `number`
|
|
84
|
+
|
|
85
|
+
The throttle time for sorting.
|
|
86
|
+
|
|
87
|
+
***
|
|
88
|
+
|
|
89
|
+
### ListRawProps
|
|
90
|
+
|
|
91
|
+
#### Properties
|
|
92
|
+
|
|
93
|
+
##### allowedFilter
|
|
94
|
+
|
|
95
|
+
> **allowedFilter**: `Function`
|
|
96
|
+
|
|
97
|
+
Function or rule to determine if an item should be included based on inclusion criteria.
|
|
98
|
+
|
|
99
|
+
##### calculatedObjectsRules
|
|
100
|
+
|
|
101
|
+
> **calculatedObjectsRules**: `Ref`\<`object`\>
|
|
102
|
+
|
|
103
|
+
Defines rules for dynamically calculating properties of list items.
|
|
104
|
+
|
|
105
|
+
##### crudArgs
|
|
106
|
+
|
|
107
|
+
> **crudArgs**: `boolean`
|
|
108
|
+
|
|
109
|
+
General arguments to pass to the registered list crud functions, often related to endpoints.
|
|
110
|
+
|
|
111
|
+
##### customDocumentOptions
|
|
112
|
+
|
|
113
|
+
> **customDocumentOptions**: `any`
|
|
114
|
+
|
|
115
|
+
FlexSearch document configuration options for advanced searching capabilities.
|
|
116
|
+
|
|
117
|
+
##### customSearchOptions
|
|
118
|
+
|
|
119
|
+
> **customSearchOptions**: `any`
|
|
120
|
+
|
|
121
|
+
Additional search options for FlexSearch.
|
|
122
|
+
|
|
123
|
+
##### excludedFilter
|
|
124
|
+
|
|
125
|
+
> **excludedFilter**: `Function`
|
|
126
|
+
|
|
127
|
+
Function or rule to determine if an item should be excluded based on exclusion criteria.
|
|
128
|
+
|
|
129
|
+
##### intendToList
|
|
130
|
+
|
|
131
|
+
> **intendToList**: `boolean`
|
|
132
|
+
|
|
133
|
+
Indicates whether the list should be fetched immediately.
|
|
134
|
+
|
|
135
|
+
##### intendToSubscribe
|
|
136
|
+
|
|
137
|
+
> **intendToSubscribe**: `boolean`
|
|
138
|
+
|
|
139
|
+
Indicates whether changes to the list should be subscribed to.
|
|
140
|
+
|
|
141
|
+
##### listArgs
|
|
142
|
+
|
|
143
|
+
> **listArgs**: `boolean`
|
|
144
|
+
|
|
145
|
+
The arguments to pass to the registered list crud functions, related to the list itself.
|
|
146
|
+
|
|
147
|
+
##### orderByRules
|
|
148
|
+
|
|
149
|
+
> **orderByRules**: [`OrderByRule`](listSort.md#orderbyrule)[]
|
|
150
|
+
|
|
151
|
+
Sorting rules that define the order of list items.
|
|
152
|
+
|
|
153
|
+
##### relatedObjectsRules
|
|
154
|
+
|
|
155
|
+
> **relatedObjectsRules**: `object`
|
|
156
|
+
|
|
157
|
+
Defines rules for associating related objects with list items.
|
|
158
|
+
|
|
159
|
+
###### Index Signature
|
|
160
|
+
|
|
161
|
+
\[`rule`: `string`\]: [`ListRelatedRule`](listRelated.md#listrelatedrule)
|
|
162
|
+
|
|
163
|
+
##### retrieveArgs
|
|
164
|
+
|
|
165
|
+
> **retrieveArgs**: `boolean`
|
|
166
|
+
|
|
167
|
+
The arguments to pass to the registered list crud functions, related to the items.
|
|
168
|
+
|
|
169
|
+
##### textSearchRules
|
|
170
|
+
|
|
171
|
+
> **textSearchRules**: [`TextSearchRules`](listSearch.md#textsearchrules-5)
|
|
172
|
+
|
|
173
|
+
Defines the properties and conditions used to filter the list via text search.
|
|
174
|
+
|
|
175
|
+
##### textSearchValue
|
|
176
|
+
|
|
177
|
+
> **textSearchValue**: `string`
|
|
178
|
+
|
|
179
|
+
Current text query used for filtering the list.
|
|
180
|
+
|
|
181
|
+
## Type Aliases
|
|
182
|
+
|
|
183
|
+
### ListFunctions
|
|
184
|
+
|
|
185
|
+
> **ListFunctions**\<\>: [`use/listInstance`](listInstance.md) & [`use/listSubscription`](listSubscription.md)
|
|
186
|
+
|
|
187
|
+
#### Type Parameters
|
|
188
|
+
|
|
189
|
+
***
|
|
190
|
+
|
|
191
|
+
### ListManaged
|
|
192
|
+
|
|
193
|
+
> **ListManaged**\<\>: `object`
|
|
194
|
+
|
|
195
|
+
#### Type Parameters
|
|
196
|
+
|
|
197
|
+
#### Type declaration
|
|
198
|
+
|
|
199
|
+
##### listCalculated
|
|
200
|
+
|
|
201
|
+
> **listCalculated**: [`use/listCalculated`](listCalculated.md)
|
|
202
|
+
|
|
203
|
+
##### listFilter
|
|
204
|
+
|
|
205
|
+
> **listFilter**: [`use/listFilter`](listFilter.md)
|
|
206
|
+
|
|
207
|
+
##### listInstance
|
|
208
|
+
|
|
209
|
+
> **listInstance**: [`use/listInstance`](listInstance.md)
|
|
210
|
+
|
|
211
|
+
##### listRelated
|
|
212
|
+
|
|
213
|
+
> **listRelated**: [`use/listRelated`](listRelated.md)
|
|
214
|
+
|
|
215
|
+
##### listSearch
|
|
216
|
+
|
|
217
|
+
> **listSearch**: [`use/listSearch`](listSearch.md)
|
|
218
|
+
|
|
219
|
+
##### listSort
|
|
220
|
+
|
|
221
|
+
> **listSort**: [`use/listSort`](listSort.md)
|
|
222
|
+
|
|
223
|
+
##### listSubscription
|
|
224
|
+
|
|
225
|
+
> **listSubscription**: [`use/listSubscription`](listSubscription.md)
|
|
226
|
+
|
|
227
|
+
***
|
|
228
|
+
|
|
229
|
+
### ListManager
|
|
230
|
+
|
|
231
|
+
> **ListManager**\<\>: [`ListFunctions`](list.md#listfunctions) & [`ListManagerProperties`](list.md#listmanagerproperties)
|
|
232
|
+
|
|
233
|
+
#### Type Parameters
|
|
234
|
+
|
|
235
|
+
***
|
|
236
|
+
|
|
237
|
+
### ListRawState
|
|
238
|
+
|
|
239
|
+
> **ListRawState**\<\>: [`use/listInstance`](listInstance.md) \| [`use/listSubscription`](listSubscription.md) \| [`use/listRelated`](listRelated.md) \| [`use/listCalculated`](listCalculated.md) \| [`use/listFilter`](listFilter.md) \| [`use/listSearch`](listSearch.md) \| [`use/listSort`](listSort.md)
|
|
240
|
+
|
|
241
|
+
#### Type Parameters
|
|
242
|
+
|
|
243
|
+
***
|
|
244
|
+
|
|
245
|
+
### ListState
|
|
246
|
+
|
|
247
|
+
> **ListState**\<\>: `UnwrapNestedRefs`
|
|
248
|
+
|
|
249
|
+
#### Type Parameters
|
|
250
|
+
|
|
251
|
+
## Functions
|
|
252
|
+
|
|
253
|
+
### useList()
|
|
254
|
+
|
|
255
|
+
> **useList**(`options`): [`ListManager`](list.md#listmanager)
|
|
256
|
+
|
|
257
|
+
#### Parameters
|
|
258
|
+
|
|
259
|
+
• **options**: [`ListOptions`](list.md#listoptions)
|
|
260
|
+
|
|
261
|
+
The options for the list./.
|
|
262
|
+
|
|
263
|
+
#### Returns
|
|
264
|
+
|
|
265
|
+
[`ListManager`](list.md#listmanager)
|
|
266
|
+
|
|
267
|
+
- The managed stack of list-related composable functions.
|
|
268
|
+
|
|
269
|
+
***
|
|
270
|
+
|
|
271
|
+
### useLists()
|
|
272
|
+
|
|
273
|
+
> **useLists**(`listOptions`): `object`
|
|
274
|
+
|
|
275
|
+
#### Parameters
|
|
276
|
+
|
|
277
|
+
• **listOptions**
|
|
278
|
+
|
|
279
|
+
The options for initializing multiple list instances.
|
|
280
|
+
|
|
281
|
+
#### Returns
|
|
282
|
+
|
|
283
|
+
`object`
|
|
284
|
+
|
|
285
|
+
- The managed list instances.
|