@arrai-innovations/reactive-helpers 17.0.0 → 17.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 +9 -9
- package/docs/config/objectCrud.md +6 -6
- package/docs/use/listSort.md +1 -1
- package/docs/use/objectInstance.md +3 -3
- package/docs/use/objectSubscription.md +1 -1
- package/docs/use/search.md +2 -2
- package/docs/use/watchesRunning.md +2 -2
- package/docs/utils/assignReactiveObject.md +14 -0
- package/docs/utils/classes.md +2 -0
- package/docs/utils/flattenPaths.md +3 -3
- package/docs/utils/keyDiff.md +7 -3
- package/docs/utils/watches.md +13 -11
- package/package.json +1 -1
- package/utils/classes.js +8 -0
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
|
-
######
|
|
346
|
+
###### args
|
|
347
347
|
|
|
348
348
|
`any`
|
|
349
349
|
|
|
350
350
|
The default arguments for the crud functions.
|
|
351
351
|
|
|
352
|
-
######
|
|
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
|
-
######
|
|
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
|
-
######
|
|
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
|
-
######
|
|
370
|
+
###### subscribe
|
|
371
371
|
|
|
372
372
|
[`SubscribeFn`](listCrud.md#subscribefn)
|
|
373
373
|
|
|
@@ -377,19 +377,19 @@ 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
|
-
######
|
|
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
|
-
######
|
|
386
|
+
###### props
|
|
387
387
|
|
|
388
|
-
`
|
|
388
|
+
\{`crudArgs`: `any`; \}
|
|
389
389
|
|
|
390
390
|
The props to set for the crud.
|
|
391
391
|
|
|
392
|
-
######
|
|
392
|
+
###### props.crudArgs
|
|
393
393
|
|
|
394
394
|
`any`
|
|
395
395
|
|
|
@@ -372,23 +372,23 @@ 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
|
-
######
|
|
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
|
-
######
|
|
381
|
+
###### props
|
|
382
382
|
|
|
383
|
-
`
|
|
383
|
+
\{`crudArgs`: \{`args`: `any`; \}; \}
|
|
384
384
|
|
|
385
385
|
The props with any passed crudArgs.
|
|
386
386
|
|
|
387
|
-
######
|
|
387
|
+
###### props.crudArgs
|
|
388
388
|
|
|
389
|
-
`
|
|
389
|
+
\{`args`: `any`; \}
|
|
390
390
|
|
|
391
|
-
######
|
|
391
|
+
###### props.crudArgs.args
|
|
392
392
|
|
|
393
393
|
`any`
|
|
394
394
|
|
package/docs/use/listSort.md
CHANGED
|
@@ -93,7 +93,7 @@ Called to turn the current object into a new object on the server.
|
|
|
93
93
|
|
|
94
94
|
###### args
|
|
95
95
|
|
|
96
|
-
######
|
|
96
|
+
###### object
|
|
97
97
|
|
|
98
98
|
`any`
|
|
99
99
|
|
|
@@ -121,7 +121,7 @@ Called to patch the current object on the server.
|
|
|
121
121
|
|
|
122
122
|
###### args
|
|
123
123
|
|
|
124
|
-
######
|
|
124
|
+
###### partialObject
|
|
125
125
|
|
|
126
126
|
[`CrudObject`](objectInstance.md#crudobject)
|
|
127
127
|
|
|
@@ -149,7 +149,7 @@ Called to update the current object on the server.
|
|
|
149
149
|
|
|
150
150
|
###### args
|
|
151
151
|
|
|
152
|
-
######
|
|
152
|
+
###### object
|
|
153
153
|
|
|
154
154
|
[`CrudObject`](objectInstance.md#crudobject)
|
|
155
155
|
|
package/docs/use/search.md
CHANGED
|
@@ -302,13 +302,13 @@ A reactive wrapper around FlexSearch.Index.
|
|
|
302
302
|
|
|
303
303
|
Options.
|
|
304
304
|
|
|
305
|
-
######
|
|
305
|
+
###### props
|
|
306
306
|
|
|
307
307
|
[`SearchProps`](search.md#searchprops)
|
|
308
308
|
|
|
309
309
|
Props.
|
|
310
310
|
|
|
311
|
-
######
|
|
311
|
+
###### throttle
|
|
312
312
|
|
|
313
313
|
`number` = `500`
|
|
314
314
|
|
|
@@ -65,13 +65,13 @@ A composable function for handling watches running. When all the trigger refs ar
|
|
|
65
65
|
|
|
66
66
|
The options for the watches running.
|
|
67
67
|
|
|
68
|
-
######
|
|
68
|
+
###### triggerRefs
|
|
69
69
|
|
|
70
70
|
`WatchSource`\<`any`\>[]
|
|
71
71
|
|
|
72
72
|
The trigger refs.
|
|
73
73
|
|
|
74
|
-
######
|
|
74
|
+
###### watchSentinelRefs
|
|
75
75
|
|
|
76
76
|
`Ref`\<`boolean`, `boolean`\>[]
|
|
77
77
|
|
|
@@ -107,10 +107,16 @@ Keys to exclude from the addition or update.
|
|
|
107
107
|
|
|
108
108
|
##### addedKeys?
|
|
109
109
|
|
|
110
|
+
Precaulcated array of keys to add, if available. Otherwise, the
|
|
111
|
+
keys will be calculated.
|
|
112
|
+
|
|
110
113
|
`any`[] | `Set`\<`any`\>
|
|
111
114
|
|
|
112
115
|
##### sameKeys?
|
|
113
116
|
|
|
117
|
+
Precaulcated array of keys to update, if available. Otherwise, the
|
|
118
|
+
keys will be calculated.
|
|
119
|
+
|
|
114
120
|
`any`[] | `Set`\<`any`\>
|
|
115
121
|
|
|
116
122
|
##### doNotSetUndefinedKeys?
|
|
@@ -194,6 +200,9 @@ Keys to exclude from the addition.
|
|
|
194
200
|
|
|
195
201
|
##### addedKeys?
|
|
196
202
|
|
|
203
|
+
Precaulcated array of keys to add, if available. Otherwise, the
|
|
204
|
+
keys will be calculated.
|
|
205
|
+
|
|
197
206
|
`any`[] | `Set`\<`any`\>
|
|
198
207
|
|
|
199
208
|
#### Returns
|
|
@@ -344,6 +353,8 @@ Keys to exclude from removal.
|
|
|
344
353
|
|
|
345
354
|
##### removedKeys?
|
|
346
355
|
|
|
356
|
+
An array to store removed keys.
|
|
357
|
+
|
|
347
358
|
`any`[] | `Set`\<`any`\>
|
|
348
359
|
|
|
349
360
|
#### Returns
|
|
@@ -386,6 +397,9 @@ Keys to exclude from the update.
|
|
|
386
397
|
|
|
387
398
|
##### sameKeys?
|
|
388
399
|
|
|
400
|
+
Precaulcated array of keys to update, if available. Otherwise, the
|
|
401
|
+
keys will be calculated.
|
|
402
|
+
|
|
389
403
|
`any`[] | `Set`\<`any`\>
|
|
390
404
|
|
|
391
405
|
#### Returns
|
package/docs/utils/classes.md
CHANGED
|
@@ -103,6 +103,8 @@ We unref your refs, so probably want a computed around this. We filter out false
|
|
|
103
103
|
|
|
104
104
|
##### cls
|
|
105
105
|
|
|
106
|
+
Handles the multiple ways of specifying CSS class related values.
|
|
107
|
+
|
|
106
108
|
[`CombinedClassesArgument`](classes.md#combinedclassesargument) | [`CombinedClassesArgument`](classes.md#combinedclassesargument)[]
|
|
107
109
|
|
|
108
110
|
#### Returns
|
|
@@ -28,19 +28,19 @@ Array or object to flatten.
|
|
|
28
28
|
|
|
29
29
|
Options.
|
|
30
30
|
|
|
31
|
-
######
|
|
31
|
+
###### currentPath
|
|
32
32
|
|
|
33
33
|
`string`
|
|
34
34
|
|
|
35
35
|
Current path, for recursion or as a starting point.
|
|
36
36
|
|
|
37
|
-
######
|
|
37
|
+
###### depth
|
|
38
38
|
|
|
39
39
|
`number`
|
|
40
40
|
|
|
41
41
|
Current depth, for recursion.
|
|
42
42
|
|
|
43
|
-
######
|
|
43
|
+
###### limit
|
|
44
44
|
|
|
45
45
|
`number`
|
|
46
46
|
|
package/docs/utils/keyDiff.md
CHANGED
|
@@ -43,29 +43,33 @@ are the same, what keys are removed, and what keys are added.
|
|
|
43
43
|
|
|
44
44
|
##### newKeys
|
|
45
45
|
|
|
46
|
+
Keys to consider as new.
|
|
47
|
+
|
|
46
48
|
`string`[] | `Set`\<`any`\>
|
|
47
49
|
|
|
48
50
|
##### oldKeys
|
|
49
51
|
|
|
52
|
+
Keys to consider as old.
|
|
53
|
+
|
|
50
54
|
`string`[] | `Set`\<`any`\>
|
|
51
55
|
|
|
52
56
|
##### options?
|
|
53
57
|
|
|
54
58
|
Which differences are returned.
|
|
55
59
|
|
|
56
|
-
######
|
|
60
|
+
###### addedKeys
|
|
57
61
|
|
|
58
62
|
`boolean` = `true`
|
|
59
63
|
|
|
60
64
|
If true, return keys that are added.
|
|
61
65
|
|
|
62
|
-
######
|
|
66
|
+
###### removedKeys
|
|
63
67
|
|
|
64
68
|
`boolean` = `true`
|
|
65
69
|
|
|
66
70
|
If true, return keys that are removed.
|
|
67
71
|
|
|
68
|
-
######
|
|
72
|
+
###### sameKeys
|
|
69
73
|
|
|
70
74
|
`boolean` = `true`
|
|
71
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
|
-
######
|
|
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
|
-
######
|
|
36
|
+
###### obj
|
|
37
37
|
|
|
38
38
|
`any`
|
|
39
39
|
|
|
40
40
|
The object containing the property to watch.
|
|
41
41
|
|
|
42
|
-
######
|
|
42
|
+
###### prop
|
|
43
43
|
|
|
44
44
|
`string`
|
|
45
45
|
|
|
46
46
|
The property name to watch within the object.
|
|
47
47
|
|
|
48
|
-
######
|
|
48
|
+
###### ref
|
|
49
49
|
|
|
50
50
|
`Ref`\<`any`, `any`\>
|
|
51
51
|
|
|
52
52
|
A Vue ref to directly watch if provided.
|
|
53
53
|
|
|
54
|
-
######
|
|
54
|
+
###### timeout
|
|
55
55
|
|
|
56
56
|
`number` = `1000`
|
|
57
57
|
|
|
@@ -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
|
-
######
|
|
219
|
+
###### timeout
|
|
220
220
|
|
|
221
221
|
`number` = `1000`
|
|
222
222
|
|
|
@@ -380,6 +380,8 @@ Starts the watch.
|
|
|
380
380
|
|
|
381
381
|
###### watchSources
|
|
382
382
|
|
|
383
|
+
The source(s) to watch.
|
|
384
|
+
|
|
383
385
|
`WatchSource`\<`any`\> | `WatchSource`\<`any`\>[]
|
|
384
386
|
|
|
385
387
|
###### watchFunc
|
|
@@ -428,31 +430,31 @@ Helper function to get the resulting promise from an AwaitNot instance.
|
|
|
428
430
|
|
|
429
431
|
Configuration options for AwaitNot.
|
|
430
432
|
|
|
431
|
-
######
|
|
433
|
+
###### couldAlreadyBeFalse
|
|
432
434
|
|
|
433
435
|
`boolean` = `true`
|
|
434
436
|
|
|
435
437
|
Indicates if the property could already be in the false state at initialization.
|
|
436
438
|
|
|
437
|
-
######
|
|
439
|
+
###### obj
|
|
438
440
|
|
|
439
441
|
`any`
|
|
440
442
|
|
|
441
443
|
The object containing the property to watch.
|
|
442
444
|
|
|
443
|
-
######
|
|
445
|
+
###### prop
|
|
444
446
|
|
|
445
447
|
`string`
|
|
446
448
|
|
|
447
449
|
The property name to watch within the object.
|
|
448
450
|
|
|
449
|
-
######
|
|
451
|
+
###### ref
|
|
450
452
|
|
|
451
453
|
`Ref`\<`any`, `any`\>
|
|
452
454
|
|
|
453
455
|
A Vue ref to directly watch if provided.
|
|
454
456
|
|
|
455
|
-
######
|
|
457
|
+
###### timeout
|
|
456
458
|
|
|
457
459
|
`number` = `1000`
|
|
458
460
|
|
package/package.json
CHANGED
package/utils/classes.js
CHANGED
|
@@ -176,5 +176,13 @@ export const stringifyClass = (cls) => {
|
|
|
176
176
|
.filter((key) => unref(/** @type {boolean | import('vue').Ref<boolean>} */ (cls[key])))
|
|
177
177
|
.join(" ");
|
|
178
178
|
}
|
|
179
|
+
if (isString(cls)) {
|
|
180
|
+
const arrayish = cls.split(/\s+/);
|
|
181
|
+
const unique = new Set(arrayish);
|
|
182
|
+
if (unique.size === arrayish.length) {
|
|
183
|
+
return cls;
|
|
184
|
+
}
|
|
185
|
+
return [...unique].join(" ");
|
|
186
|
+
}
|
|
179
187
|
return cls;
|
|
180
188
|
};
|