@arrai-innovations/reactive-helpers 17.0.2 → 18.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/docs/config/listCrud.md +7 -7
- package/docs/config/objectCrud.md +3 -3
- package/docs/use/loadingError.md +1 -1
- package/docs/use/object.md +2 -2
- package/docs/use/objectCalculated.md +4 -4
- package/docs/use/objectRelated.md +2 -2
- package/docs/use/objectSubscription.md +1 -1
- package/docs/use/search.md +1 -1
- package/docs/utils/flattenPaths.md +3 -3
- package/docs/utils/getFakePk.md +2 -1
- package/docs/utils/keyDiff.md +3 -3
- package/docs/utils/watches.md +13 -13
- package/package.json +9 -10
- package/use/loadingError.js +1 -1
- package/utils/getFakePk.js +2 -1
package/docs/config/listCrud.md
CHANGED
|
@@ -343,31 +343,31 @@ Get the previously set list and subscribe functions for the default crud.
|
|
|
343
343
|
|
|
344
344
|
The reactive crud object, which will be mutated.
|
|
345
345
|
|
|
346
|
-
###### args
|
|
346
|
+
###### args?
|
|
347
347
|
|
|
348
348
|
`any`
|
|
349
349
|
|
|
350
350
|
The default arguments for the crud functions.
|
|
351
351
|
|
|
352
|
-
###### bulkDelete
|
|
352
|
+
###### bulkDelete?
|
|
353
353
|
|
|
354
354
|
[`BulkDeleteFn`](listCrud.md#bulkdeletefn)
|
|
355
355
|
|
|
356
356
|
The delete function to bulk delete a list of items.
|
|
357
357
|
|
|
358
|
-
###### executeAction
|
|
358
|
+
###### executeAction?
|
|
359
359
|
|
|
360
360
|
[`ExecuteActionFn`](listCrud.md#executeactionfn)
|
|
361
361
|
|
|
362
362
|
The function to execute a certain action on a list of items.
|
|
363
363
|
|
|
364
|
-
###### list
|
|
364
|
+
###### list?
|
|
365
365
|
|
|
366
366
|
[`ListFn`](listCrud.md#listfn)
|
|
367
367
|
|
|
368
368
|
The list function to get a list of items.
|
|
369
369
|
|
|
370
|
-
###### subscribe
|
|
370
|
+
###### subscribe?
|
|
371
371
|
|
|
372
372
|
[`SubscribeFn`](listCrud.md#subscribefn)
|
|
373
373
|
|
|
@@ -377,13 +377,13 @@ The subscribe function to get a subscription to a list of items.
|
|
|
377
377
|
|
|
378
378
|
The options for the default crud.
|
|
379
379
|
|
|
380
|
-
###### functions
|
|
380
|
+
###### functions?
|
|
381
381
|
|
|
382
382
|
[`ListCrudFunctions`](listCrud.md#listcrudfunctions) & [`ListCrudArgs`](listCrud.md#listcrudargs)
|
|
383
383
|
|
|
384
384
|
The functions to set for the crud.
|
|
385
385
|
|
|
386
|
-
###### props
|
|
386
|
+
###### props?
|
|
387
387
|
|
|
388
388
|
\{ `crudArgs`: `any`; \}
|
|
389
389
|
|
|
@@ -372,13 +372,13 @@ The reactive object you want to add the resulting crud to.
|
|
|
372
372
|
|
|
373
373
|
The options for the reactive crud object.
|
|
374
374
|
|
|
375
|
-
###### functions
|
|
375
|
+
###### functions?
|
|
376
376
|
|
|
377
377
|
[`ObjectCrudFunctions`](objectCrud.md#objectcrudfunctions)
|
|
378
378
|
|
|
379
379
|
Any functions to override the default crud functions.
|
|
380
380
|
|
|
381
|
-
###### props
|
|
381
|
+
###### props?
|
|
382
382
|
|
|
383
383
|
\{ `crudArgs`: \{ `args`: `any`; \}; \}
|
|
384
384
|
|
|
@@ -388,7 +388,7 @@ The props with any passed crudArgs.
|
|
|
388
388
|
|
|
389
389
|
\{ `args`: `any`; \}
|
|
390
390
|
|
|
391
|
-
###### props.crudArgs.args
|
|
391
|
+
###### props.crudArgs.args?
|
|
392
392
|
|
|
393
393
|
`any`
|
|
394
394
|
|
package/docs/use/loadingError.md
CHANGED
package/docs/use/object.md
CHANGED
|
@@ -206,7 +206,7 @@ The calculated object.
|
|
|
206
206
|
|
|
207
207
|
###### Index Signature
|
|
208
208
|
|
|
209
|
-
\[`ruleKey`: `string`\]: `ComputedRef
|
|
209
|
+
\[`ruleKey`: `string`\]: `ComputedRef`\<`any`\>
|
|
210
210
|
|
|
211
211
|
###### calculatedObjectRules
|
|
212
212
|
|
|
@@ -402,7 +402,7 @@ The related objects, indexed by the key in the related object.
|
|
|
402
402
|
|
|
403
403
|
###### Index Signature
|
|
404
404
|
|
|
405
|
-
\[`rule`: `string`\]: `ComputedRef
|
|
405
|
+
\[`rule`: `string`\]: `ComputedRef`\<`any`\>
|
|
406
406
|
|
|
407
407
|
###### relatedObjectRules
|
|
408
408
|
|
|
@@ -200,7 +200,7 @@ The related objects, indexed by the key in the related object.
|
|
|
200
200
|
|
|
201
201
|
###### Index Signature
|
|
202
202
|
|
|
203
|
-
\[`rule`: `string`\]: `ComputedRef
|
|
203
|
+
\[`rule`: `string`\]: `ComputedRef`\<`any`\>
|
|
204
204
|
|
|
205
205
|
###### relatedObjectRules?
|
|
206
206
|
|
|
@@ -270,7 +270,7 @@ The calculated object.
|
|
|
270
270
|
|
|
271
271
|
###### Index Signature
|
|
272
272
|
|
|
273
|
-
\[`ruleKey`: `string`\]: `ComputedRef
|
|
273
|
+
\[`ruleKey`: `string`\]: `ComputedRef`\<`any`\>
|
|
274
274
|
|
|
275
275
|
###### calculatedObjectRules
|
|
276
276
|
|
|
@@ -466,7 +466,7 @@ The related objects, indexed by the key in the related object.
|
|
|
466
466
|
|
|
467
467
|
###### Index Signature
|
|
468
468
|
|
|
469
|
-
\[`rule`: `string`\]: `ComputedRef
|
|
469
|
+
\[`rule`: `string`\]: `ComputedRef`\<`any`\>
|
|
470
470
|
|
|
471
471
|
###### relatedObjectRules?
|
|
472
472
|
|
|
@@ -556,7 +556,7 @@ The calculated object.
|
|
|
556
556
|
|
|
557
557
|
###### Index Signature
|
|
558
558
|
|
|
559
|
-
\[`ruleKey`: `string`\]: `ComputedRef
|
|
559
|
+
\[`ruleKey`: `string`\]: `ComputedRef`\<`any`\>
|
|
560
560
|
|
|
561
561
|
##### calculatedObjectRules
|
|
562
562
|
|
|
@@ -398,7 +398,7 @@ The related objects, indexed by the key in the related object.
|
|
|
398
398
|
|
|
399
399
|
###### Index Signature
|
|
400
400
|
|
|
401
|
-
\[`rule`: `string`\]: `ComputedRef
|
|
401
|
+
\[`rule`: `string`\]: `ComputedRef`\<`any`\>
|
|
402
402
|
|
|
403
403
|
###### relatedObjectRules
|
|
404
404
|
|
|
@@ -492,7 +492,7 @@ The related objects, indexed by the key in the related object.
|
|
|
492
492
|
|
|
493
493
|
###### Index Signature
|
|
494
494
|
|
|
495
|
-
\[`rule`: `string`\]: `ComputedRef
|
|
495
|
+
\[`rule`: `string`\]: `ComputedRef`\<`any`\>
|
|
496
496
|
|
|
497
497
|
##### relatedObjectRules
|
|
498
498
|
|
package/docs/use/search.md
CHANGED
|
@@ -28,19 +28,19 @@ Array or object to flatten.
|
|
|
28
28
|
|
|
29
29
|
Options.
|
|
30
30
|
|
|
31
|
-
###### currentPath
|
|
31
|
+
###### currentPath?
|
|
32
32
|
|
|
33
33
|
`string`
|
|
34
34
|
|
|
35
35
|
Current path, for recursion or as a starting point.
|
|
36
36
|
|
|
37
|
-
###### depth
|
|
37
|
+
###### depth?
|
|
38
38
|
|
|
39
39
|
`number`
|
|
40
40
|
|
|
41
41
|
Current depth, for recursion.
|
|
42
42
|
|
|
43
|
-
###### limit
|
|
43
|
+
###### limit?
|
|
44
44
|
|
|
45
45
|
`number`
|
|
46
46
|
|
package/docs/utils/getFakePk.md
CHANGED
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
> **getFakePk**(`arraySetMapOrObject`, `key`): `string`
|
|
14
14
|
|
|
15
|
-
Get a fake pk that is not in the array, set, map, or object.
|
|
15
|
+
Get a fake pk that is not in the array, set, map, or object. The fake pk is negative number, so they can be
|
|
16
|
+
differentiated from real ids. They are returned as strings, as javascript object property keys are always strings.
|
|
16
17
|
|
|
17
18
|
#### Parameters
|
|
18
19
|
|
package/docs/utils/keyDiff.md
CHANGED
|
@@ -57,19 +57,19 @@ Keys to consider as old.
|
|
|
57
57
|
|
|
58
58
|
Which differences are returned.
|
|
59
59
|
|
|
60
|
-
###### addedKeys
|
|
60
|
+
###### addedKeys?
|
|
61
61
|
|
|
62
62
|
`boolean` = `true`
|
|
63
63
|
|
|
64
64
|
If true, return keys that are added.
|
|
65
65
|
|
|
66
|
-
###### removedKeys
|
|
66
|
+
###### removedKeys?
|
|
67
67
|
|
|
68
68
|
`boolean` = `true`
|
|
69
69
|
|
|
70
70
|
If true, return keys that are removed.
|
|
71
71
|
|
|
72
|
-
###### sameKeys
|
|
72
|
+
###### sameKeys?
|
|
73
73
|
|
|
74
74
|
`boolean` = `true`
|
|
75
75
|
|
package/docs/utils/watches.md
CHANGED
|
@@ -27,31 +27,31 @@ Initializes the AwaitNot with specified options for reactive property watching a
|
|
|
27
27
|
|
|
28
28
|
Configuration options for AwaitNot.
|
|
29
29
|
|
|
30
|
-
###### couldAlreadyBeFalse
|
|
30
|
+
###### couldAlreadyBeFalse?
|
|
31
31
|
|
|
32
32
|
`boolean` = `false`
|
|
33
33
|
|
|
34
34
|
Indicates if the property could already be in the false state at initialization.
|
|
35
35
|
|
|
36
|
-
###### obj
|
|
36
|
+
###### obj?
|
|
37
37
|
|
|
38
38
|
`any`
|
|
39
39
|
|
|
40
40
|
The object containing the property to watch.
|
|
41
41
|
|
|
42
|
-
###### prop
|
|
42
|
+
###### prop?
|
|
43
43
|
|
|
44
44
|
`string`
|
|
45
45
|
|
|
46
46
|
The property name to watch within the object.
|
|
47
47
|
|
|
48
|
-
###### ref
|
|
48
|
+
###### ref?
|
|
49
49
|
|
|
50
|
-
`Ref`
|
|
50
|
+
`Ref`\<`any`, `any`\>
|
|
51
51
|
|
|
52
52
|
A Vue ref to directly watch if provided.
|
|
53
53
|
|
|
54
|
-
###### timeout
|
|
54
|
+
###### timeout?
|
|
55
55
|
|
|
56
56
|
`number` = `1000`
|
|
57
57
|
|
|
@@ -77,7 +77,7 @@ The timeout in milliseconds before the promise is rejected.
|
|
|
77
77
|
|
|
78
78
|
##### ref
|
|
79
79
|
|
|
80
|
-
> **ref**: `Readonly`\<`Ref
|
|
80
|
+
> **ref**: `Readonly`\<`Ref`\<`any`, `any`\>\>
|
|
81
81
|
|
|
82
82
|
##### reject()
|
|
83
83
|
|
|
@@ -216,7 +216,7 @@ Creates an instance of AwaitTimeout with a specified timeout duration.
|
|
|
216
216
|
|
|
217
217
|
The options for the AwaitTimeout.
|
|
218
218
|
|
|
219
|
-
###### timeout
|
|
219
|
+
###### timeout?
|
|
220
220
|
|
|
221
221
|
`number` = `1000`
|
|
222
222
|
|
|
@@ -398,7 +398,7 @@ Optional arguments to pass to the watch function.
|
|
|
398
398
|
|
|
399
399
|
###### watchOptions?
|
|
400
400
|
|
|
401
|
-
`WatchOptions
|
|
401
|
+
`WatchOptions`\<`boolean`\> = `{}`
|
|
402
402
|
|
|
403
403
|
Optional watch options.
|
|
404
404
|
|
|
@@ -430,7 +430,7 @@ Helper function to get the resulting promise from an AwaitNot instance.
|
|
|
430
430
|
|
|
431
431
|
Configuration options for AwaitNot.
|
|
432
432
|
|
|
433
|
-
###### couldAlreadyBeFalse
|
|
433
|
+
###### couldAlreadyBeFalse?
|
|
434
434
|
|
|
435
435
|
`boolean` = `true`
|
|
436
436
|
|
|
@@ -448,13 +448,13 @@ The object containing the property to watch.
|
|
|
448
448
|
|
|
449
449
|
The property name to watch within the object.
|
|
450
450
|
|
|
451
|
-
###### ref
|
|
451
|
+
###### ref?
|
|
452
452
|
|
|
453
|
-
`Ref`
|
|
453
|
+
`Ref`\<`any`, `any`\>
|
|
454
454
|
|
|
455
455
|
A Vue ref to directly watch if provided.
|
|
456
456
|
|
|
457
|
-
###### timeout
|
|
457
|
+
###### timeout?
|
|
458
458
|
|
|
459
459
|
`number` = `1000`
|
|
460
460
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arrai-innovations/reactive-helpers",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.1",
|
|
4
4
|
"description": "VueJS 3 utility composition functions to help manipulate objects and lists.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -10,11 +10,10 @@
|
|
|
10
10
|
"tests": "tests"
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
|
-
"test": "npx vitest",
|
|
13
|
+
"test": "npx --no-install vitest",
|
|
14
14
|
"eslint": "npx --no-install eslint --fix index.js config/**/*.js tests/**/*.js use/**/*.js utils/**/*.js",
|
|
15
15
|
"prettier": "npx --no-install prettier --write .",
|
|
16
|
-
"coverage": "npm
|
|
17
|
-
"coverage:clean": "rm -rf coverage",
|
|
16
|
+
"coverage": "npm test -- run --coverage=true",
|
|
18
17
|
"prepare": "npx --no-install husky",
|
|
19
18
|
"docs": "node make_type_doc.js"
|
|
20
19
|
},
|
|
@@ -29,7 +28,7 @@
|
|
|
29
28
|
},
|
|
30
29
|
"homepage": "https://github.com/arrai-innovations/reactive-helpers#readme",
|
|
31
30
|
"devDependencies": {
|
|
32
|
-
"@arrai-innovations/commitlint-config": "^
|
|
31
|
+
"@arrai-innovations/commitlint-config": "^2.0.0",
|
|
33
32
|
"@commitlint/cli": "^19.4.0",
|
|
34
33
|
"@godaddy/dmd": "^1.0.4",
|
|
35
34
|
"@trivago/prettier-plugin-sort-imports": "^5.2.1",
|
|
@@ -37,7 +36,7 @@
|
|
|
37
36
|
"@types/lodash-es": "^4.17.12",
|
|
38
37
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
39
38
|
"@typescript-eslint/parser": "^7.18.0",
|
|
40
|
-
"@vitest/coverage-v8": "^
|
|
39
|
+
"@vitest/coverage-v8": "^3.0.8",
|
|
41
40
|
"@vue/compiler-sfc": "^3.4.37",
|
|
42
41
|
"@vue/eslint-config-prettier": "^9.0.0",
|
|
43
42
|
"@vue/test-utils": "^2.3.2",
|
|
@@ -48,7 +47,7 @@
|
|
|
48
47
|
"eslint-plugin-vitest-globals": "^1.3.1",
|
|
49
48
|
"eslint-plugin-vue": "^9.27.0",
|
|
50
49
|
"flush-promises": "^1.0.2",
|
|
51
|
-
"globals": "^
|
|
50
|
+
"globals": "^16.0.0",
|
|
52
51
|
"husky": "^9.1.7",
|
|
53
52
|
"jsdom": "^26.0.0",
|
|
54
53
|
"lint-staged": "^15.2.8",
|
|
@@ -56,7 +55,7 @@
|
|
|
56
55
|
"typedoc": "^0.27.1",
|
|
57
56
|
"typedoc-plugin-markdown": "^4.3.0",
|
|
58
57
|
"typescript": "^5.5.4",
|
|
59
|
-
"vitest": "^
|
|
58
|
+
"vitest": "^3.0.8"
|
|
60
59
|
},
|
|
61
60
|
"dependencies": {
|
|
62
61
|
"@jcoreio/async-throttle": "^1.6.0",
|
|
@@ -65,8 +64,8 @@
|
|
|
65
64
|
"vue-deepunref": "^1.0.1"
|
|
66
65
|
},
|
|
67
66
|
"peerDependencies": {
|
|
68
|
-
"@vueuse/core": "^
|
|
67
|
+
"@vueuse/core": "^13.0.0",
|
|
69
68
|
"lodash-es": "^4.17.21",
|
|
70
|
-
"vue": "^3.
|
|
69
|
+
"vue": "^3.5.13"
|
|
71
70
|
}
|
|
72
71
|
}
|
package/use/loadingError.js
CHANGED
|
@@ -24,7 +24,7 @@ import { readonly, ref } from "vue";
|
|
|
24
24
|
* @typedef {object} LoadingErrorMutations
|
|
25
25
|
* @property {() => void} setLoading - Set the loading state.
|
|
26
26
|
* @property {() => void} clearLoading - Clear the loading state.
|
|
27
|
-
* @property {(error) => void} setError - Set the error state.
|
|
27
|
+
* @property {(error: Error) => void} setError - Set the error state.
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
30
|
/**
|
package/utils/getFakePk.js
CHANGED
|
@@ -3,7 +3,8 @@ import isMap from "lodash-es/isMap.js";
|
|
|
3
3
|
import isSet from "lodash-es/isSet.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Get a fake pk that is not in the array, set, map, or object.
|
|
6
|
+
* Get a fake pk that is not in the array, set, map, or object. The fake pk is negative number, so they can be
|
|
7
|
+
* differentiated from real ids. They are returned as strings, as javascript object property keys are always strings.
|
|
7
8
|
*
|
|
8
9
|
* @param {Array|Set|Map|object} arraySetMapOrObject - The array, set, map, or object to check for the fake pk.
|
|
9
10
|
* An array is assumed to be an array of objects.
|