@tempots/ui 8.0.1 → 9.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/index.cjs +1 -1
- package/index.js +382 -398
- package/package.json +3 -3
- package/renderables/mutation.d.ts +6 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tempots/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@floating-ui/dom": "^1.6.7"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@tempots/std": "0.
|
|
44
|
-
"@tempots/dom": "30.
|
|
43
|
+
"@tempots/std": "0.24.0",
|
|
44
|
+
"@tempots/dom": "30.1.0"
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -10,25 +10,14 @@ import { MutationResource, MutationResourceExecuteOptions } from '../utils/mutat
|
|
|
10
10
|
*/
|
|
11
11
|
export interface MutationDisplayOptions<Req, Res, E> {
|
|
12
12
|
/** Function to render when the query is loading. */
|
|
13
|
-
|
|
13
|
+
content: (options: {
|
|
14
14
|
previous: Signal<Res | undefined>;
|
|
15
|
-
retry: () => void;
|
|
16
15
|
execute: (request: Req) => void;
|
|
17
16
|
cancel: (newState?: NonLoading<Res, E>) => void;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
retry: () => void;
|
|
23
|
-
execute: (request: Req) => void;
|
|
24
|
-
}) => TNode;
|
|
25
|
-
/** Function to render when the query has successfully loaded. */
|
|
26
|
-
success: (options: {
|
|
27
|
-
value: Signal<Res>;
|
|
28
|
-
execute: (request: Req) => void;
|
|
29
|
-
}) => TNode;
|
|
30
|
-
notAsked: (options: {
|
|
31
|
-
execute: (request: Req) => void;
|
|
17
|
+
pending: Signal<boolean>;
|
|
18
|
+
error: Signal<E | undefined>;
|
|
19
|
+
value: Signal<Res | undefined>;
|
|
20
|
+
status: Signal<AsyncResult<Res, E>>;
|
|
32
21
|
}) => TNode;
|
|
33
22
|
}
|
|
34
23
|
/**
|
|
@@ -60,7 +49,7 @@ export declare const MutationDisplay: <Req, Res, E>(resource: MutationResource<R
|
|
|
60
49
|
* @returns {Renderable} A node representing the current state of the resource.
|
|
61
50
|
* @public
|
|
62
51
|
*/
|
|
63
|
-
export declare const Mutation: <Req, Res, E = unknown>({ mutate, convertError, onSuccess, onError, onSettled,
|
|
52
|
+
export declare const Mutation: <Req, Res, E = unknown>({ mutate, convertError, onSuccess, onError, onSettled, content, }: {
|
|
64
53
|
mutate: (options: MutationResourceExecuteOptions<Req, Res, E>) => Promise<Res>;
|
|
65
54
|
convertError?: (error: unknown) => E;
|
|
66
55
|
onSuccess?: (value: Res, req: Req) => void;
|