@tempots/ui 10.5.0 → 10.6.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/package.json +2 -2
- package/renderables/mutation.d.ts +10 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tempots/ui",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -41,6 +41,6 @@
|
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@tempots/std": "0.24.0",
|
|
44
|
-
"@tempots/dom": "31.
|
|
44
|
+
"@tempots/dom": "31.5.0"
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { Renderable, Signal, TNode } from '@tempots/dom';
|
|
2
2
|
import { AsyncResult, NonLoading } from '@tempots/std';
|
|
3
3
|
import { MutationResource, MutationResourceExecuteOptions } from '../utils/mutation-resource';
|
|
4
|
+
export interface MutationContentOptions<Req, Res, E> {
|
|
5
|
+
previous: Signal<Res | undefined>;
|
|
6
|
+
execute: (request: Req) => void;
|
|
7
|
+
cancel: (newState?: NonLoading<Res, E>) => void;
|
|
8
|
+
pending: Signal<boolean>;
|
|
9
|
+
error: Signal<E | undefined>;
|
|
10
|
+
value: Signal<Res | undefined>;
|
|
11
|
+
status: Signal<AsyncResult<Res, E>>;
|
|
12
|
+
}
|
|
4
13
|
/**
|
|
5
14
|
* Options for displaying the different states of an asynchronous resource.
|
|
6
15
|
*
|
|
@@ -10,15 +19,7 @@ import { MutationResource, MutationResourceExecuteOptions } from '../utils/mutat
|
|
|
10
19
|
*/
|
|
11
20
|
export interface MutationDisplayOptions<Req, Res, E> {
|
|
12
21
|
/** Function to render when the query is loading. */
|
|
13
|
-
content: (options:
|
|
14
|
-
previous: Signal<Res | undefined>;
|
|
15
|
-
execute: (request: Req) => void;
|
|
16
|
-
cancel: (newState?: NonLoading<Res, E>) => void;
|
|
17
|
-
pending: Signal<boolean>;
|
|
18
|
-
error: Signal<E | undefined>;
|
|
19
|
-
value: Signal<Res | undefined>;
|
|
20
|
-
status: Signal<AsyncResult<Res, E>>;
|
|
21
|
-
}) => TNode;
|
|
22
|
+
content: (options: MutationContentOptions<Req, Res, E>) => TNode;
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
24
25
|
* Component to display an asynchronous mutation based on its current status.
|