@arrai-innovations/reactive-helpers 19.0.0 → 20.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 +44 -53
- package/config/commonCrud.js +9 -9
- package/config/listCrud.js +24 -26
- package/config/objectCrud.js +29 -29
- package/package.json +3 -3
- package/types/config/commonCrud.d.ts +5 -5
- package/types/config/commonCrud.d.ts.map +1 -1
- package/types/config/listCrud.d.ts +25 -33
- package/types/config/listCrud.d.ts.map +1 -1
- package/types/config/objectCrud.d.ts +35 -35
- package/types/config/objectCrud.d.ts.map +1 -1
- package/types/use/cancellableIntent.d.ts +43 -7
- package/types/use/cancellableIntent.d.ts.map +1 -1
- package/types/use/list.d.ts +8 -12
- package/types/use/list.d.ts.map +1 -1
- package/types/use/listCalculated.d.ts +2 -3
- package/types/use/listCalculated.d.ts.map +1 -1
- package/types/use/listInstance.d.ts +18 -31
- package/types/use/listInstance.d.ts.map +1 -1
- package/types/use/listKeys.d.ts.map +1 -1
- package/types/use/listRelated.d.ts +2 -5
- package/types/use/listRelated.d.ts.map +1 -1
- package/types/use/listSort.d.ts +2 -3
- package/types/use/listSort.d.ts.map +1 -1
- package/types/use/listSubscription.d.ts +3 -6
- package/types/use/listSubscription.d.ts.map +1 -1
- package/types/use/object.d.ts +4 -4
- package/types/use/object.d.ts.map +1 -1
- package/types/use/objectCalculated.d.ts +2 -2
- package/types/use/objectInstance.d.ts +19 -19
- package/types/use/objectInstance.d.ts.map +1 -1
- package/types/use/objectRelated.d.ts +2 -2
- package/types/use/objectSubscription.d.ts +7 -7
- package/types/use/objectSubscription.d.ts.map +1 -1
- package/use/cancellableIntent.js +24 -16
- package/use/list.js +16 -20
- package/use/listCalculated.js +2 -3
- package/use/listInstance.js +19 -26
- package/use/listKeys.js +1 -2
- package/use/listRelated.js +2 -5
- package/use/listSort.js +2 -3
- package/use/listSubscription.js +14 -23
- package/use/object.js +6 -6
- package/use/objectCalculated.js +2 -2
- package/use/objectInstance.js +22 -22
- package/use/objectRelated.js +2 -2
- package/use/objectSubscription.js +18 -18
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Assigns the default CRUD
|
|
2
|
+
* Assigns the default CRUD handlers to the target object.
|
|
3
3
|
*
|
|
4
4
|
* @param {object} target - The reactive object to assign to.
|
|
5
5
|
* @param {object} defaultCrud - The default CRUD definition (usually created by `createDefaultCrud`).
|
|
6
6
|
* @param {object} [options] - The options object.
|
|
7
7
|
* @param {object} [options.props] - The props object.
|
|
8
|
-
* @param {object} [options.
|
|
9
|
-
* @param {Set<string>} [options.validKeys] - The valid keys for the
|
|
8
|
+
* @param {object} [options.handlers] - The functions to assign.
|
|
9
|
+
* @param {Set<string>} [options.validKeys] - The valid keys for the handlers.
|
|
10
10
|
*/
|
|
11
|
-
export function assignCrud(target: object, defaultCrud: object, { props,
|
|
11
|
+
export function assignCrud(target: object, defaultCrud: object, { props, handlers, validKeys }?: {
|
|
12
12
|
props?: object;
|
|
13
|
-
|
|
13
|
+
handlers?: object;
|
|
14
14
|
validKeys?: Set<string>;
|
|
15
15
|
}): void;
|
|
16
16
|
export function missingMethod(name: string): (...args: any[]) => import("../utils/cancellablePromise.js").MaybeCancellablePromise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commonCrud.d.ts","sourceRoot":"","sources":["../../config/commonCrud.js"],"names":[],"mappings":"AA4CA;;;;;;;;;GASG;AACH,mCAPW,MAAM,eACN,MAAM,
|
|
1
|
+
{"version":3,"file":"commonCrud.d.ts","sourceRoot":"","sources":["../../config/commonCrud.js"],"names":[],"mappings":"AA4CA;;;;;;;;;GASG;AACH,mCAPW,MAAM,eACN,MAAM,mCAEd;IAAyB,KAAK,GAAtB,MAAM;IACW,QAAQ,GAAzB,MAAM;IACgB,SAAS,GAA/B,GAAG,CAAC,MAAM,CAAC;CACrB,QAqBA;AAhEM,oCAHI,MAAM,GACJ,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,gCAAgC,EAAE,uBAAuB,CAAC,GAAG,CAAC,CAGjB;AAU9E,kDALI,MAAM,GACJ,CACZ,CAAO,GAAG,KAAK,EAAE,GAAG,EAAE,KAAK,OAAO,gCAAgC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CACzF,CAOwG;AAUrG,wCAJI,MAAM,EAAE,oBACR,GAAG,CAAC,MAAM,CAAC,GACT,MAAM,CAQlB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The default list crud
|
|
2
|
+
* The default list crud handlers.
|
|
3
3
|
*
|
|
4
|
-
* @type {Readonly<
|
|
4
|
+
* @type {Readonly<ListCrudHandlers>}
|
|
5
5
|
*/
|
|
6
|
-
export const defaultListCrud: Readonly<
|
|
7
|
-
export function setListCrud({ args, ...rest }:
|
|
8
|
-
export function getListCrud(target: import("vue").UnwrapNestedRefs<
|
|
9
|
-
props?: import("vue").UnwrapNestedRefs<
|
|
10
|
-
|
|
6
|
+
export const defaultListCrud: Readonly<ListCrudHandlers>;
|
|
7
|
+
export function setListCrud({ args, ...rest }: ListCrudHandlers & Partial<ListTarget>): void;
|
|
8
|
+
export function getListCrud(target: import("vue").UnwrapNestedRefs<ListCrudHandlers & ListTarget>, options: {
|
|
9
|
+
props?: import("vue").UnwrapNestedRefs<ListTargetOption>;
|
|
10
|
+
handlers?: ListCrudHandlers;
|
|
11
11
|
}): void;
|
|
12
12
|
export type PaginateInfo = {
|
|
13
13
|
/**
|
|
@@ -26,21 +26,17 @@ export type PaginateInfo = {
|
|
|
26
26
|
export type PageCallback = (newObjects: import("../use/listInstance.js").ListObject, paginationInfo: PaginateInfo | undefined) => void;
|
|
27
27
|
export type ListArgs = {
|
|
28
28
|
/**
|
|
29
|
-
* - The arguments to be passed to the crud
|
|
29
|
+
* - The arguments to be passed to the crud handlers.
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
target: object;
|
|
32
32
|
/**
|
|
33
33
|
* - The key name of the primary key.
|
|
34
34
|
*/
|
|
35
35
|
pkKey: string;
|
|
36
36
|
/**
|
|
37
|
-
* - The arguments to be passed
|
|
37
|
+
* - The arguments to be passed for list crud handlers.
|
|
38
38
|
*/
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* - The arguments to be passed for list crud functions.
|
|
42
|
-
*/
|
|
43
|
-
listArgs: object;
|
|
39
|
+
params: object;
|
|
44
40
|
/**
|
|
45
41
|
* - The method to call with new page(s) of data received.
|
|
46
42
|
*/
|
|
@@ -53,9 +49,9 @@ export type ListArgs = {
|
|
|
53
49
|
};
|
|
54
50
|
export type BulkDeleteArgs = {
|
|
55
51
|
/**
|
|
56
|
-
* - The arguments to be passed to the crud
|
|
52
|
+
* - The arguments to be passed to the crud handlers.
|
|
57
53
|
*/
|
|
58
|
-
|
|
54
|
+
target: object;
|
|
59
55
|
/**
|
|
60
56
|
* - The ids of the objects to be deleted.
|
|
61
57
|
*/
|
|
@@ -73,21 +69,17 @@ export type BulkDeleteArgs = {
|
|
|
73
69
|
export type SubscriptionEventCallback = (newOrUpdatedOrDeleteObject: import("../use/listInstance.js").ListObject | string, action: "create" | "update" | "delete") => void;
|
|
74
70
|
export type ListSubscribeArgs = {
|
|
75
71
|
/**
|
|
76
|
-
* - The arguments to be passed to the crud
|
|
72
|
+
* - The arguments to be passed to the crud handlers.
|
|
77
73
|
*/
|
|
78
|
-
|
|
74
|
+
target: object;
|
|
79
75
|
/**
|
|
80
76
|
* - The key name of the primary key.
|
|
81
77
|
*/
|
|
82
78
|
pkKey: string;
|
|
83
79
|
/**
|
|
84
|
-
* - The arguments to be passed
|
|
85
|
-
*/
|
|
86
|
-
retrieveArgs: object;
|
|
87
|
-
/**
|
|
88
|
-
* - The arguments to be passed for list crud functions.
|
|
80
|
+
* - The arguments to be passed for list crud handlers.
|
|
89
81
|
*/
|
|
90
|
-
|
|
82
|
+
params: object;
|
|
91
83
|
/**
|
|
92
84
|
* - The method to call when new data is received.
|
|
93
85
|
*/
|
|
@@ -100,9 +92,9 @@ export type ListSubscribeArgs = {
|
|
|
100
92
|
};
|
|
101
93
|
export type ExecuteActionArgs = {
|
|
102
94
|
/**
|
|
103
|
-
* - The arguments to be passed to the crud
|
|
95
|
+
* - The arguments to be passed to the crud handlers.
|
|
104
96
|
*/
|
|
105
|
-
|
|
97
|
+
target: object;
|
|
106
98
|
/**
|
|
107
99
|
* - The ids of the objects to be acted upon.
|
|
108
100
|
*/
|
|
@@ -125,7 +117,7 @@ export type CrudListFn = (args: ListArgs) => import("../utils/cancellablePromise
|
|
|
125
117
|
export type CrudBulkDeleteFn = (args: BulkDeleteArgs) => import("../utils/cancellablePromise.js").MaybeCancellablePromise<void>;
|
|
126
118
|
export type CrudListSubscribeFn = (args: ListSubscribeArgs) => import("../utils/cancellablePromise.js").CancellablePromise<void>;
|
|
127
119
|
export type CrudExecuteActionFn = (args: ExecuteActionArgs) => import("../utils/cancellablePromise.js").MaybeCancellablePromise<object | string | null>;
|
|
128
|
-
export type
|
|
120
|
+
export type ListCrudHandlers = {
|
|
129
121
|
/**
|
|
130
122
|
* - The list function to get a list of items.
|
|
131
123
|
*/
|
|
@@ -143,16 +135,16 @@ export type ListCrudFunctions = {
|
|
|
143
135
|
*/
|
|
144
136
|
subscribe?: CrudListSubscribeFn;
|
|
145
137
|
};
|
|
146
|
-
export type
|
|
138
|
+
export type ListTarget = {
|
|
147
139
|
/**
|
|
148
|
-
* - The default arguments for the crud
|
|
140
|
+
* - The default arguments for the crud handlers.
|
|
149
141
|
*/
|
|
150
142
|
args: object;
|
|
151
143
|
};
|
|
152
|
-
export type
|
|
144
|
+
export type ListTargetOption = {
|
|
153
145
|
/**
|
|
154
|
-
* - The default arguments for the crud
|
|
146
|
+
* - The default arguments for the crud handlers.
|
|
155
147
|
*/
|
|
156
|
-
|
|
148
|
+
target?: object;
|
|
157
149
|
};
|
|
158
150
|
//# sourceMappingURL=listCrud.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listCrud.d.ts","sourceRoot":"","sources":["../../config/listCrud.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"listCrud.d.ts","sourceRoot":"","sources":["../../config/listCrud.js"],"names":[],"mappings":"AAkHA;;;;GAIG;AACH,8BAFU,QAAQ,CAAC,gBAAgB,CAAC,CAEkB;AAS/C,+CAJI,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,GAEpC,IAAI,CAUhB;AAWM,oCANI,OAAO,KAAK,EAAE,gBAAgB,CAAC,gBAAgB,GAAG,UAAU,CAAC,WAErE;IAAmE,KAAK,GAAhE,OAAO,KAAK,EAAE,gBAAgB,CAAC,gBAAgB,CAAC;IACrB,QAAQ,GAAnC,gBAAgB;CACxB,QAIF;;;;;kBAzIa,MAAM;;;;gBACN,MAAM;;;;aACN,MAAM;;2BAIP,CACN,UAAU,EAAC,OAAO,wBAAwB,EAAE,UAAU,EACtD,cAAc,EAAE,YAAY,GAAC,SAAS,KACvC,IAAI;;;;;YAKI,MAAM;;;;WACN,MAAM;;;;YACN,MAAM;;;;kBACN,YAAY;;;;;iBACZ,QAAQ,CAAC,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;;;;;;YAMpC,MAAM;;;;SACN,MAAM,EAAE;;;;WACR,MAAM;;;;;iBACN,QAAQ,CAAC,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;;wCAKrC,CACN,0BAA0B,EAAC,OAAO,wBAAwB,EAAE,UAAU,GAAC,MAAM,EAC7E,MAAM,EAAE,QAAQ,GAAC,QAAQ,GAAC,QAAQ,KACnC,IAAI;;;;;YAKI,MAAM;;;;WACN,MAAM;;;;YACN,MAAM;;;;+BACN,yBAAyB;;;;;iBACzB,QAAQ,CAAC,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;;;;;;YAMpC,MAAM;;;;SACN,MAAM,EAAE;;;;WACR,MAAM;;;;YACN,MAAM;;;;;iBACN,QAAQ,CAAC,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;;gCAMvC,QAAQ,KACN,OAAO,gCAAgC,EAAE,uBAAuB,CAAC,IAAI,CAAC;sCAKxE,cAAc,KACZ,OAAO,gCAAgC,EAAE,uBAAuB,CAAC,IAAI,CAAC;yCAKxE,iBAAiB,KACf,OAAO,gCAAgC,EAAE,kBAAkB,CAAC,IAAI,CAAC;yCAKnE,iBAAiB,KACf,OAAO,gCAAgC,EAAE,uBAAuB,CAAC,MAAM,GAAC,MAAM,GAAC,IAAI,CAAC;;;;;WAKnF,UAAU;;;;iBACV,gBAAgB;;;;oBAChB,mBAAmB;;;;gBACnB,mBAAmB;;;;;;UAKnB,MAAM;;;;;;aAKN,MAAM"}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The default object crud
|
|
2
|
+
* The default object crud handlers.
|
|
3
3
|
*
|
|
4
|
-
* @type {Readonly<
|
|
4
|
+
* @type {Readonly<ObjectCrudHandlers>}
|
|
5
5
|
*/
|
|
6
|
-
export const defaultObjectCrud: Readonly<
|
|
7
|
-
export function setObjectCrud({ args, ...rest }:
|
|
8
|
-
export function getObjectCrud(target: import("vue").UnwrapNestedRefs<
|
|
9
|
-
props?: import("vue").UnwrapNestedRefs<
|
|
10
|
-
|
|
6
|
+
export const defaultObjectCrud: Readonly<ObjectCrudHandlers>;
|
|
7
|
+
export function setObjectCrud({ args, ...rest }: ObjectTarget): void;
|
|
8
|
+
export function getObjectCrud(target: import("vue").UnwrapNestedRefs<ObjectTargetProperties>, options: {
|
|
9
|
+
props?: import("vue").UnwrapNestedRefs<ObjectTargetOption>;
|
|
10
|
+
handlers?: ObjectCrudHandlers;
|
|
11
11
|
}): void;
|
|
12
|
-
export type
|
|
12
|
+
export type ObjectTargetArgs = {
|
|
13
13
|
[key: string]: any;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
|
-
* Defines the CRUD-related
|
|
16
|
+
* Defines the CRUD-related handlers and additional utilities provided by the object instance.
|
|
17
17
|
*/
|
|
18
|
-
export type
|
|
18
|
+
export type ObjectTargetProperties = {
|
|
19
19
|
/**
|
|
20
|
-
* - The arguments to be passed to the crud
|
|
20
|
+
* - The arguments to be passed to the crud handlers.
|
|
21
21
|
*/
|
|
22
|
-
args:
|
|
22
|
+
args: ObjectTargetArgs;
|
|
23
23
|
};
|
|
24
|
-
export type
|
|
24
|
+
export type ObjectTargetOption = {
|
|
25
25
|
/**
|
|
26
|
-
* - The arguments to be passed to the crud
|
|
26
|
+
* - The arguments to be passed to the crud handlers.
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
target?: ObjectTargetArgs;
|
|
29
29
|
};
|
|
30
30
|
export type CreateArgs = {
|
|
31
31
|
/**
|
|
32
|
-
* - The arguments to be passed to the crud
|
|
32
|
+
* - The arguments to be passed to the crud handlers.
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
target: {
|
|
35
35
|
[key: string]: any;
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
@@ -43,7 +43,7 @@ export type CreateArgs = {
|
|
|
43
43
|
/**
|
|
44
44
|
* - The arguments to be passed to the retrieve function.
|
|
45
45
|
*/
|
|
46
|
-
|
|
46
|
+
params: {
|
|
47
47
|
[key: string]: any;
|
|
48
48
|
};
|
|
49
49
|
/**
|
|
@@ -57,9 +57,9 @@ export type CreateArgs = {
|
|
|
57
57
|
};
|
|
58
58
|
export type RetrieveArgs = {
|
|
59
59
|
/**
|
|
60
|
-
* - The arguments to be passed to the crud
|
|
60
|
+
* - The arguments to be passed to the crud handlers.
|
|
61
61
|
*/
|
|
62
|
-
|
|
62
|
+
target: {
|
|
63
63
|
[key: string]: any;
|
|
64
64
|
};
|
|
65
65
|
/**
|
|
@@ -73,7 +73,7 @@ export type RetrieveArgs = {
|
|
|
73
73
|
/**
|
|
74
74
|
* - The arguments to be passed to the retrieve function.
|
|
75
75
|
*/
|
|
76
|
-
|
|
76
|
+
params: {
|
|
77
77
|
[key: string]: any;
|
|
78
78
|
};
|
|
79
79
|
/**
|
|
@@ -83,9 +83,9 @@ export type RetrieveArgs = {
|
|
|
83
83
|
};
|
|
84
84
|
export type UpdateArgs = {
|
|
85
85
|
/**
|
|
86
|
-
* - The arguments to be passed to the crud
|
|
86
|
+
* - The arguments to be passed to the crud handlers.
|
|
87
87
|
*/
|
|
88
|
-
|
|
88
|
+
target: {
|
|
89
89
|
[key: string]: any;
|
|
90
90
|
};
|
|
91
91
|
/**
|
|
@@ -95,7 +95,7 @@ export type UpdateArgs = {
|
|
|
95
95
|
/**
|
|
96
96
|
* - The arguments to be passed to the retrieve function.
|
|
97
97
|
*/
|
|
98
|
-
|
|
98
|
+
params: {
|
|
99
99
|
[key: string]: any;
|
|
100
100
|
};
|
|
101
101
|
/**
|
|
@@ -109,9 +109,9 @@ export type UpdateArgs = {
|
|
|
109
109
|
};
|
|
110
110
|
export type DeleteArgs = {
|
|
111
111
|
/**
|
|
112
|
-
* - The arguments to be passed to the crud
|
|
112
|
+
* - The arguments to be passed to the crud handlers.
|
|
113
113
|
*/
|
|
114
|
-
|
|
114
|
+
target: {
|
|
115
115
|
[key: string]: any;
|
|
116
116
|
};
|
|
117
117
|
/**
|
|
@@ -129,9 +129,9 @@ export type DeleteArgs = {
|
|
|
129
129
|
};
|
|
130
130
|
export type PartialArgs = {
|
|
131
131
|
/**
|
|
132
|
-
* - The arguments to be passed to the crud
|
|
132
|
+
* - The arguments to be passed to the crud handlers.
|
|
133
133
|
*/
|
|
134
|
-
|
|
134
|
+
target: {
|
|
135
135
|
[key: string]: any;
|
|
136
136
|
};
|
|
137
137
|
/**
|
|
@@ -151,7 +151,7 @@ export type PartialArgs = {
|
|
|
151
151
|
/**
|
|
152
152
|
* - The arguments to be passed to the retrieve function.
|
|
153
153
|
*/
|
|
154
|
-
|
|
154
|
+
params: {
|
|
155
155
|
[key: string]: any;
|
|
156
156
|
};
|
|
157
157
|
/**
|
|
@@ -162,9 +162,9 @@ export type PartialArgs = {
|
|
|
162
162
|
export type CrudSubscribeCallback = (data: import("../use/objectInstance.js").ExistingCrudObject, action: string) => any;
|
|
163
163
|
export type ObjectSubscribeArgs = {
|
|
164
164
|
/**
|
|
165
|
-
* - The arguments to be passed to the crud
|
|
165
|
+
* - The arguments to be passed to the crud handlers.
|
|
166
166
|
*/
|
|
167
|
-
|
|
167
|
+
target: {
|
|
168
168
|
[key: string]: any;
|
|
169
169
|
};
|
|
170
170
|
/**
|
|
@@ -178,7 +178,7 @@ export type ObjectSubscribeArgs = {
|
|
|
178
178
|
/**
|
|
179
179
|
* - The arguments to be passed to the retrieve function.
|
|
180
180
|
*/
|
|
181
|
-
|
|
181
|
+
params: {
|
|
182
182
|
[key: string]: any;
|
|
183
183
|
};
|
|
184
184
|
/**
|
|
@@ -198,9 +198,9 @@ export type CrudPatchFn = (args: PartialArgs) => CrudResponse;
|
|
|
198
198
|
export type CrudDeleteFn = (args: DeleteArgs) => CrudResponse;
|
|
199
199
|
export type CrudObjectSubscribeFn = (args: ObjectSubscribeArgs) => import("../utils/cancellablePromise.js").CancellablePromise<void>;
|
|
200
200
|
/**
|
|
201
|
-
* Defines the CRUD-related
|
|
201
|
+
* Defines the CRUD-related handlers and additional utilities provided by the object instance.
|
|
202
202
|
*/
|
|
203
|
-
export type
|
|
203
|
+
export type ObjectCrudHandlers = {
|
|
204
204
|
/**
|
|
205
205
|
* - A function to be used instead of the default crud create function.
|
|
206
206
|
*/
|
|
@@ -229,5 +229,5 @@ export type ObjectCrudFunctions = {
|
|
|
229
229
|
/**
|
|
230
230
|
* The CRUD arguments.
|
|
231
231
|
*/
|
|
232
|
-
export type
|
|
232
|
+
export type ObjectTarget = ObjectTargetProperties & ObjectCrudHandlers;
|
|
233
233
|
//# sourceMappingURL=objectCrud.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectCrud.d.ts","sourceRoot":"","sources":["../../config/objectCrud.js"],"names":[],"mappings":"AAuJA;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@module use/cancellableIntent.js - A composable function for handling cancellable intents.
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* @typedef {
|
|
6
|
-
* @property {number} activeCount - The number of active intents.
|
|
7
|
-
* @property {boolean} active - Whether there are active intents.
|
|
8
|
-
* @property {number} resolvingCount - The number of resolving intents.
|
|
9
|
-
* @property {boolean} resolving - Whether there are resolving intents.
|
|
5
|
+
* @typedef {object} CancellableIntentRawState - The raw state of the cancellable intent.
|
|
6
|
+
* @property {number|undefined} activeCount - The number of active intents.
|
|
7
|
+
* @property {boolean|undefined} active - Whether there are active intents.
|
|
8
|
+
* @property {number|undefined} resolvingCount - The number of resolving intents.
|
|
9
|
+
* @property {boolean|undefined} resolving - Whether there are resolving intents.
|
|
10
10
|
* @property {boolean} errored - Whether there was an error.
|
|
11
|
-
* @property {Error} error - The error that occurred.
|
|
11
|
+
* @property {Error|null} error - The error that occurred.
|
|
12
12
|
* @property {boolean} clearActiveOnResolved - Whether to clear the active state when the promise resolves.
|
|
13
13
|
*/
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {import("vue").UnwrapNestedRefs<CancellableIntentRawState>} CancellableIntentState - The state of the cancellable intent.
|
|
16
|
+
*/
|
|
14
17
|
/**
|
|
15
18
|
* @typedef {object} CancellableIntentOptions - The options for the cancellable intent.
|
|
16
19
|
* @property {() => import('../utils/cancellablePromise.js').MaybeCancellablePromise<void>} awaitableWithCancel - The function that returns a promise that can be cancelled.
|
|
@@ -65,10 +68,43 @@
|
|
|
65
68
|
* @returns {CancellableIntent} - The instance of the cancellable intent.
|
|
66
69
|
*/
|
|
67
70
|
export function useCancellableIntent({ awaitableWithCancel, watchArguments, guardArguments, clearActiveOnResolved, }: CancellableIntentOptions): CancellableIntent;
|
|
71
|
+
/**
|
|
72
|
+
* - The raw state of the cancellable intent.
|
|
73
|
+
*/
|
|
74
|
+
export type CancellableIntentRawState = {
|
|
75
|
+
/**
|
|
76
|
+
* - The number of active intents.
|
|
77
|
+
*/
|
|
78
|
+
activeCount: number | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* - Whether there are active intents.
|
|
81
|
+
*/
|
|
82
|
+
active: boolean | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* - The number of resolving intents.
|
|
85
|
+
*/
|
|
86
|
+
resolvingCount: number | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* - Whether there are resolving intents.
|
|
89
|
+
*/
|
|
90
|
+
resolving: boolean | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* - Whether there was an error.
|
|
93
|
+
*/
|
|
94
|
+
errored: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* - The error that occurred.
|
|
97
|
+
*/
|
|
98
|
+
error: Error | null;
|
|
99
|
+
/**
|
|
100
|
+
* - Whether to clear the active state when the promise resolves.
|
|
101
|
+
*/
|
|
102
|
+
clearActiveOnResolved: boolean;
|
|
103
|
+
};
|
|
68
104
|
/**
|
|
69
105
|
* - The state of the cancellable intent.
|
|
70
106
|
*/
|
|
71
|
-
export type CancellableIntentState = import("vue").UnwrapNestedRefs<
|
|
107
|
+
export type CancellableIntentState = import("vue").UnwrapNestedRefs<CancellableIntentRawState>;
|
|
72
108
|
/**
|
|
73
109
|
* - The options for the cancellable intent.
|
|
74
110
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancellableIntent.d.ts","sourceRoot":"","sources":["../../use/cancellableIntent.js"],"names":[],"mappings":"AAOA;;GAEG;AAEH;;;;;;;;;GASG;AAEH;;;;;;GAMG;AAEH;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,sHAHW,wBAAwB,GACtB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"cancellableIntent.d.ts","sourceRoot":"","sources":["../../use/cancellableIntent.js"],"names":[],"mappings":"AAOA;;GAEG;AAEH;;;;;;;;;GASG;AAEH;;GAEG;AAEH;;;;;;GAMG;AAEH;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,sHAHW,wBAAwB,GACtB,iBAAiB,CA6L7B;;;;;;;;iBA/Pa,MAAM,GAAC,SAAS;;;;YAChB,OAAO,GAAC,SAAS;;;;oBACjB,MAAM,GAAC,SAAS;;;;eAChB,OAAO,GAAC,SAAS;;;;aACjB,OAAO;;;;WACP,KAAK,GAAC,IAAI;;;;2BACV,OAAO;;;;;qCAIR,OAAO,KAAK,EAAE,gBAAgB,CAAC,yBAAyB,CAAC;;;;;;;;yBAKxD,MAAM,OAAO,gCAAgC,EAAE,uBAAuB,CAAC,IAAI,CAAC;;;;qBAC5E,OAAO,KAAK,EAAE,gBAAgB,CAAC,MAAM,CAAC;;;;qBACtC,OAAO,KAAK,EAAE,gBAAgB,CAAC,MAAM,CAAC;;;;4BACtC,OAAO;;;;;;;;;WAKP,sBAAsB;;;;oBACtB,OAAO,KAAK,EAAE,gBAAgB,CAAC,MAAM,CAAC;;;;oBACtC,OAAO,KAAK,EAAE,gBAAgB,CAAC,MAAM,CAAC"}
|
package/types/use/list.d.ts
CHANGED
|
@@ -24,27 +24,23 @@ export function useLists(listOptions: {
|
|
|
24
24
|
}): {
|
|
25
25
|
[key: string]: ListManager;
|
|
26
26
|
};
|
|
27
|
-
export function useList({ props,
|
|
27
|
+
export function useList({ props, handlers, paged, keepOldPages, clearListOnListIntentTriggered, searchThrottle, sortThrottleWait, searchShowAllWhenEmpty, }: ListOptions): ListManager;
|
|
28
28
|
/**
|
|
29
29
|
* Defines properties for configuring the list management system.
|
|
30
30
|
*/
|
|
31
31
|
export type ListRawProps = {
|
|
32
32
|
/**
|
|
33
|
-
* - The arguments to pass to the registered list crud
|
|
33
|
+
* - The arguments to pass to the registered list crud handlers, related to the list itself.
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
params: object;
|
|
36
36
|
/**
|
|
37
37
|
* - The primary key for the list items.
|
|
38
38
|
*/
|
|
39
39
|
pkKey: string;
|
|
40
40
|
/**
|
|
41
|
-
* -
|
|
41
|
+
* - General arguments to pass to the registered list crud handlers, often related to endpoints.
|
|
42
42
|
*/
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* - General arguments to pass to the registered list crud functions, often related to endpoints.
|
|
46
|
-
*/
|
|
47
|
-
crudArgs: object;
|
|
43
|
+
target: object;
|
|
48
44
|
/**
|
|
49
45
|
* - Indicates whether the list should be fetched immediately.
|
|
50
46
|
*/
|
|
@@ -96,9 +92,9 @@ export type ListOptions = {
|
|
|
96
92
|
*/
|
|
97
93
|
props: ListRawProps;
|
|
98
94
|
/**
|
|
99
|
-
* - Additional
|
|
95
|
+
* - Additional handlers to be included in the list manager.
|
|
100
96
|
*/
|
|
101
|
-
|
|
97
|
+
handlers: import("../config/listCrud.js").ListCrudHandlers;
|
|
102
98
|
/**
|
|
103
99
|
* - Indicates whether the list should be paginated.
|
|
104
100
|
*/
|
|
@@ -128,7 +124,7 @@ export type ListOptions = {
|
|
|
128
124
|
* Represents the combined state definitions for all list-related components.
|
|
129
125
|
* This interface aggregates the raw state from multiple list management functionalities.
|
|
130
126
|
*/
|
|
131
|
-
export type ListRawState = (import("./listInstance.js").ListInstanceRawState
|
|
127
|
+
export type ListRawState = (import("./listInstance.js").ListInstanceRawState & import("./listSubscription.js").ListSubscriptionRawState & import("./listRelated.js").ListRelatedRawState & import("./listCalculated.js").ListCalculatedRawState & import("./listFilter.js").ListFilterRawState & import("./listSearch.js").ListSearchRawState & import("./listSort.js").ListSortRawState);
|
|
132
128
|
/**
|
|
133
129
|
* Represents the reactive state derived from aggregating states of various list-related components.
|
|
134
130
|
* This state is typically used within Vue components for reactivity and access to updated list properties.
|
package/types/use/list.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../use/list.js"],"names":[],"mappings":"AAmBA;;;;;;;GAOG;AAEH;;GAEG;AACH;IACI;;;;;OAKG;IACH,qBAHW,MAAM,QACN,M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5C;IACN,YAAY,EAAE,OAAO,mBAAmB,EAAE,YAAY,CAAC;IACvD,gBAAgB,EAAE,OAAO,uBAAuB,EAAE,gBAAgB,CAAC;IACnE,WAAW,EAAE,OAAO,kBAAkB,EAAE,WAAW,CAAC;IACpD,cAAc,EAAE,OAAO,qBAAqB,EAAE,cAAc,CAAC;IAC7D,UAAU,EAAE,OAAO,iBAAiB,EAAE,UAAU,CAAC;IACjD,UAAU,EAAE,OAAO,iBAAiB,EAAE,UAAU,CAAC;IACjD,QAAQ,EAAE,OAAO,eAAe,EAAE,QAAQ,CAAA;CAC7C;;;;4BAMS,CACZ,OAAa,mBAAmB,EAAE,qBAAqB,GAC/C,OAAO,uBAAuB,EAAE,yBAAyB,CAC9D;;;;;;;;;aAcU,WAAW;;;;WACX,SAAS;;;;iBACT,OAAO,KAAK,EAAE,WAAW;;;;;;0BAO1B,aAAa,GAAG,qBAAqB"}
|
|
@@ -49,10 +49,9 @@ export function useListCalculateds(listCalculatedArgs: {
|
|
|
49
49
|
*
|
|
50
50
|
* const listSubscriptionProps = reactive({
|
|
51
51
|
* // whatever props you need to get the list to work with your crud implementation
|
|
52
|
-
*
|
|
53
|
-
*
|
|
52
|
+
* target: {},
|
|
53
|
+
* params: {},
|
|
54
54
|
* pkKey: "pk",
|
|
55
|
-
* retrieveArgs: {},
|
|
56
55
|
* intendToList: true,
|
|
57
56
|
* });
|
|
58
57
|
* const listSubscription = useListSubscription(listSubscriptionProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listCalculated.d.ts","sourceRoot":"","sources":["../../use/listCalculated.js"],"names":[],"mappings":"AAoGA;;;;;;;;GAQG;AAEH;;;;;;;;GAQG;AAIH;;;;GAIG;AAEH;;;;;;;GAOG;AACH,uDALW;IACV,CAAO,GAAG,EAAE,MAAM,GAAG,qBAAqB,CAAA;CACvC,GACS;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;CAAC,CAS3C;AAED
|
|
1
|
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AAE,oBAAoB,GAChD,OAAO,CAAC,OAAO,uBAAuB,EAAE,wBAAwB,CAAC,GACjE,OAAO,CAAC,OAAO,kBAAkB,EAAE,mBAAmB,CAAC,CAC1D;;;;kCAMS,OAAO,KAAK,EAAE,gBAAgB,CACpC,4BAA4B,GAC5B,sBAAsB,CACzB;;;;;wCAOS,OAAO,KAAK,EAAE,gBAAgB,CAAC,CAC3C,OAAa,mBAAmB,EAAE,oBAAoB,GAChD,OAAO,CAAC,OAAO,uBAAuB,EAAE,wBAAwB,CAAC,GACjE,OAAO,CAAC,OAAO,kBAAkB,EAAE,mBAAmB,CAAC,CAC1D,CAAC"}
|
|
@@ -3,23 +3,22 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @typedef {object} ListInstanceProps
|
|
5
5
|
* @property {string} pkKey - The primary key field for the list objects.
|
|
6
|
-
* @property {object}
|
|
7
|
-
* @property {object}
|
|
8
|
-
* @property {object} crudArgs - Implementation specific arguments.
|
|
6
|
+
* @property {object} params - The arguments passed to the server.
|
|
7
|
+
* @property {object} target - Implementation specific arguments.
|
|
9
8
|
*/
|
|
10
9
|
/**
|
|
11
10
|
* The configuration options used to create a list instance.
|
|
12
11
|
*
|
|
13
12
|
* @typedef {object} ListInstanceOptions
|
|
14
13
|
* @property {import('vue').UnwrapNestedRefs<ListInstanceProps>} props - The props for the list instance.
|
|
15
|
-
* @property {object} [
|
|
16
|
-
* @property {import('../config/listCrud.js').CrudListFn} [
|
|
14
|
+
* @property {object} [handlers] - Default implementation are used as set by `setListCrud`.
|
|
15
|
+
* @property {import('../config/listCrud.js').CrudListFn} [handlers.list] - Provide the implementation for the list
|
|
17
16
|
* function.
|
|
18
|
-
* @property {import('../config/listCrud.js').CrudBulkDeleteFn} [
|
|
17
|
+
* @property {import('../config/listCrud.js').CrudBulkDeleteFn} [handlers.bulkDelete] - Provide the implementation for the bulkDelete
|
|
19
18
|
* function.
|
|
20
|
-
* @property {import('../config/listCrud.js').CrudExecuteActionFn} [
|
|
19
|
+
* @property {import('../config/listCrud.js').CrudExecuteActionFn} [handlers.executeAction] - Provide the implementation for the executeAction
|
|
21
20
|
* function.
|
|
22
|
-
* @property {import('../config/listCrud.js').CrudListSubscribeFn} [
|
|
21
|
+
* @property {import('../config/listCrud.js').CrudListSubscribeFn} [handlers.subscribe] - Provide the implementation for the
|
|
23
22
|
* subscribe function.
|
|
24
23
|
* @property {boolean} keepOldPages - If true, pages will not be cleared when defaultPageCallback is called.
|
|
25
24
|
*/
|
|
@@ -42,12 +41,11 @@
|
|
|
42
41
|
* The raw state object for the list instance, defining the reactive properties and their types.
|
|
43
42
|
*
|
|
44
43
|
* @typedef {object} ListInstanceRawState
|
|
45
|
-
* @property {object} crud - CRUD
|
|
46
|
-
* @property {object} crud.args - Arguments for the CRUD
|
|
44
|
+
* @property {object} crud - CRUD handlers and their configurations for the list.
|
|
45
|
+
* @property {object} crud.args - Arguments for the CRUD handlers.
|
|
47
46
|
* @property {Function} [crud.list] - Function to list objects.
|
|
48
47
|
* @property {string} pkKey - The primary key field for the list objects.
|
|
49
|
-
* @property {object}
|
|
50
|
-
* @property {object} listArgs - Arguments passed to the server for listing operations.
|
|
48
|
+
* @property {object} params - Arguments passed to the server for listing operations.
|
|
51
49
|
* @property {ObjectsByPk} objects - The list objects stored by their pks.
|
|
52
50
|
* @property {boolean} running - Indicates if there are ongoing reactive updates.
|
|
53
51
|
* @property {Readonly<import('vue').Ref<boolean>>} [loading] - Indicates if the list is currently loading.
|
|
@@ -116,16 +114,13 @@ export function useListInstances(listInstanceArgs: {
|
|
|
116
114
|
* });
|
|
117
115
|
*
|
|
118
116
|
* const listInstanceProps = reactive({
|
|
119
|
-
*
|
|
117
|
+
* target: {
|
|
120
118
|
* // whatever arguments are required for your configured list crud function to get the right endpoint
|
|
121
119
|
* },
|
|
122
|
-
*
|
|
120
|
+
* params: {
|
|
123
121
|
* // whatever arguments are required for your configured list function to get the right list
|
|
124
122
|
* someListFilter: toRef(props, "someListFilter"),
|
|
125
123
|
* },
|
|
126
|
-
* retrieveArgs: {
|
|
127
|
-
* // whatever arguments are required for your configured list function to get items back looking as expected
|
|
128
|
-
* },
|
|
129
124
|
* });
|
|
130
125
|
* const listInstance = useListInstance({ props: listInstanceProps });
|
|
131
126
|
* watch(toRef(props, "someListFilter"), (newValue, oldValue) => {
|
|
@@ -152,7 +147,7 @@ export function useListInstances(listInstanceArgs: {
|
|
|
152
147
|
* @returns {ListInstance} The list instance.
|
|
153
148
|
* @throws {ListInstanceError} If the props or keepOldPages are missing.
|
|
154
149
|
*/
|
|
155
|
-
export function useListInstance({ props,
|
|
150
|
+
export function useListInstance({ props, handlers, keepOldPages }: ListInstanceOptions): ListInstance;
|
|
156
151
|
/**
|
|
157
152
|
* A composable function for managing a list of objects.
|
|
158
153
|
*
|
|
@@ -189,15 +184,11 @@ export type ListInstanceProps = {
|
|
|
189
184
|
/**
|
|
190
185
|
* - The arguments passed to the server.
|
|
191
186
|
*/
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* - The arguments passed to the server.
|
|
195
|
-
*/
|
|
196
|
-
listArgs: object;
|
|
187
|
+
params: object;
|
|
197
188
|
/**
|
|
198
189
|
* - Implementation specific arguments.
|
|
199
190
|
*/
|
|
200
|
-
|
|
191
|
+
target: object;
|
|
201
192
|
};
|
|
202
193
|
/**
|
|
203
194
|
* The configuration options used to create a list instance.
|
|
@@ -210,7 +201,7 @@ export type ListInstanceOptions = {
|
|
|
210
201
|
/**
|
|
211
202
|
* - Default implementation are used as set by `setListCrud`.
|
|
212
203
|
*/
|
|
213
|
-
|
|
204
|
+
handlers?: {
|
|
214
205
|
list?: import("../config/listCrud.js").CrudListFn;
|
|
215
206
|
bulkDelete?: import("../config/listCrud.js").CrudBulkDeleteFn;
|
|
216
207
|
executeAction?: import("../config/listCrud.js").CrudExecuteActionFn;
|
|
@@ -240,7 +231,7 @@ export type ListOrder = import("vue").ComputedRef<string[]>;
|
|
|
240
231
|
*/
|
|
241
232
|
export type ListInstanceRawState = {
|
|
242
233
|
/**
|
|
243
|
-
* - CRUD
|
|
234
|
+
* - CRUD handlers and their configurations for the list.
|
|
244
235
|
*/
|
|
245
236
|
crud: {
|
|
246
237
|
args: object;
|
|
@@ -250,14 +241,10 @@ export type ListInstanceRawState = {
|
|
|
250
241
|
* - The primary key field for the list objects.
|
|
251
242
|
*/
|
|
252
243
|
pkKey: string;
|
|
253
|
-
/**
|
|
254
|
-
* - Arguments passed to the server for retrieval operations.
|
|
255
|
-
*/
|
|
256
|
-
retrieveArgs: object;
|
|
257
244
|
/**
|
|
258
245
|
* - Arguments passed to the server for listing operations.
|
|
259
246
|
*/
|
|
260
|
-
|
|
247
|
+
params: object;
|
|
261
248
|
/**
|
|
262
249
|
* - The list objects stored by their pks.
|
|
263
250
|
*/
|