@arrai-innovations/reactive-helpers 12.0.0 → 13.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.
Files changed (115) hide show
  1. package/.husky/pre-commit +0 -1
  2. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  3. package/.prettierignore +1 -0
  4. package/README.md +11 -10
  5. package/config/listCrud.js +32 -1
  6. package/config/objectCrud.js +47 -1
  7. package/docs/README.md +43 -0
  8. package/docs/config/listCrud.md +97 -0
  9. package/docs/config/objectCrud.md +123 -0
  10. package/docs/use/cancellableIntent.md +163 -0
  11. package/docs/use/combineClasses.md +52 -0
  12. package/docs/use/list.md +285 -0
  13. package/docs/use/listCalculated.md +773 -0
  14. package/docs/use/listFilter.md +877 -0
  15. package/docs/use/listInstance.md +483 -0
  16. package/docs/use/listKeys.md +91 -0
  17. package/docs/use/listRelated.md +685 -0
  18. package/docs/use/listSearch.md +889 -0
  19. package/docs/use/listSort.md +1144 -0
  20. package/docs/use/listSubscription.md +379 -0
  21. package/docs/use/loadingError.md +21 -0
  22. package/docs/use/object.md +437 -0
  23. package/docs/use/objectCalculated.md +606 -0
  24. package/docs/use/objectInstance.md +486 -0
  25. package/docs/use/objectRelated.md +588 -0
  26. package/docs/use/objectSubscription.md +459 -0
  27. package/docs/use/paginatedListInstance.md +147 -0
  28. package/docs/use/search.md +311 -0
  29. package/docs/use/watchesRunning.md +80 -0
  30. package/docs/utils/assignReactiveObject.md +351 -0
  31. package/docs/utils/classes.md +100 -0
  32. package/docs/utils/compact.md +57 -0
  33. package/docs/utils/deleteKey.md +53 -0
  34. package/docs/utils/flattenPaths.md +45 -0
  35. package/docs/utils/getFakeId.md +34 -0
  36. package/docs/utils/keyDiff.md +101 -0
  37. package/docs/utils/loadingCombine.md +28 -0
  38. package/docs/utils/proxyRunning.md +33 -0
  39. package/docs/utils/relatedCalculatedHelpers.md +75 -0
  40. package/docs/utils/set.md +139 -0
  41. package/docs/utils/transformWalk.md +33 -0
  42. package/docs/utils/watches.md +441 -0
  43. package/eslint.config.js +125 -0
  44. package/index.js +34 -3
  45. package/lint-staged.config.js +5 -1
  46. package/makeTypeDoc.sh +25 -0
  47. package/package.json +27 -19
  48. package/tests/unit/config/listCrud.spec.js +5 -0
  49. package/tests/unit/config/objectCrud.spec.js +5 -0
  50. package/tests/unit/crudPromise.js +22 -3
  51. package/tests/unit/mockOnUnmounted.js +1 -1
  52. package/tests/unit/use/cancellableIntent.spec.js +2 -0
  53. package/tests/unit/use/listCalculated.spec.js +4 -3
  54. package/tests/unit/use/listFilter.spec.js +11 -7
  55. package/tests/unit/use/listInstance.spec.js +32 -14
  56. package/tests/unit/use/listRelated.spec.js +3 -2
  57. package/tests/unit/use/listSearch.spec.js +9 -7
  58. package/tests/unit/use/listSort.spec.js +29 -22
  59. package/tests/unit/use/listSubscription.spec.js +11 -5
  60. package/tests/unit/use/objectInstance.spec.js +15 -2
  61. package/tests/unit/use/objectSubscription.spec.js +31 -16
  62. package/tests/unit/use/search.spec.js +2 -2
  63. package/tests/unit/utils/assignReactiveObject.spec.js +21 -13
  64. package/tests/unit/utils/classes.spec.js +7 -6
  65. package/tests/unit/utils/watches.spec.js +4 -4
  66. package/tsconfig.json +19 -0
  67. package/typedoc-local-plugins/customize-output.js +13 -0
  68. package/typedoc.json +12 -0
  69. package/use/cancellableIntent.js +73 -2
  70. package/use/combineClasses.js +41 -31
  71. package/use/list.js +139 -5
  72. package/use/listCalculated.js +175 -10
  73. package/use/listFilter.js +175 -21
  74. package/use/listInstance.js +215 -94
  75. package/use/listRelated.js +260 -72
  76. package/use/listSearch.js +178 -57
  77. package/use/listSort.js +188 -21
  78. package/use/listSubscription.js +211 -63
  79. package/use/loadingError.js +43 -0
  80. package/use/object.js +187 -23
  81. package/use/objectCalculated.js +168 -16
  82. package/use/objectInstance.js +183 -102
  83. package/use/objectRelated.js +276 -84
  84. package/use/objectSubscription.js +169 -17
  85. package/use/paginatedListInstance.js +30 -1
  86. package/use/search.js +39 -23
  87. package/use/watchesRunning.js +41 -6
  88. package/utils/assignReactiveObject.js +139 -88
  89. package/utils/classes.js +57 -48
  90. package/utils/compact.js +28 -2
  91. package/utils/deleteKey.js +14 -1
  92. package/utils/flattenPaths.js +19 -9
  93. package/utils/getFakeId.js +11 -1
  94. package/utils/keyDiff.js +26 -35
  95. package/utils/loadingCombine.js +7 -4
  96. package/utils/proxyRunning.js +16 -8
  97. package/utils/relatedCalculatedHelpers.js +17 -0
  98. package/utils/set.js +66 -0
  99. package/utils/transformWalk.js +7 -6
  100. package/utils/watches.js +205 -71
  101. package/.eslintignore +0 -2
  102. package/.eslintrc.cjs +0 -25
  103. package/.jsdoc2md.json +0 -4
  104. package/config/index.js +0 -2
  105. package/docs.md +0 -1002
  106. package/jsdoc-to-markdown.sh +0 -16
  107. package/tests/unit/.eslintrc.cjs +0 -11
  108. package/tests/unit/config/index.spec.js +0 -18
  109. package/tests/unit/use/index.spec.js +0 -18
  110. package/tests/unit/utils/index.spec.js +0 -18
  111. package/use/index.js +0 -19
  112. package/utils/debugMessage.js +0 -209
  113. package/utils/debugWatch.js +0 -29
  114. package/utils/index.js +0 -16
  115. package/utils/lifecycleDebug.js +0 -126
@@ -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.