@open-xamu-co/ui-common-types 3.1.0-next.2 → 3.1.0-next.4
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/src/values.ts +19 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-xamu-co/ui-common-types",
|
|
3
|
-
"version": "3.1.0-next.
|
|
3
|
+
"version": "3.1.0-next.4",
|
|
4
4
|
"description": "Xamu shared types",
|
|
5
5
|
"author": "@xamu-co",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"build:legacy": "rimraf dist && tsc --outDir dist --declaration --emitDeclarationOnly"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@open-xamu-co/ui-common-enums": "^3.0
|
|
34
|
+
"@open-xamu-co/ui-common-enums": "^3.1.0-next.1",
|
|
35
35
|
"@fortawesome/fontawesome-common-types": "^6.4.0",
|
|
36
36
|
"sweetalert2": "^11.11.1"
|
|
37
37
|
},
|
package/src/values.ts
CHANGED
|
@@ -18,7 +18,10 @@ export type iNodeFn<T extends Record<string, any>, Ta extends [T?, ...any[]] = [
|
|
|
18
18
|
) => boolean | undefined | iNodeFnResponse | Promise<boolean | undefined | iNodeFnResponse>;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Used on Table and related components
|
|
22
|
+
*
|
|
23
|
+
* @action Any task performed at each row cell (property)
|
|
24
|
+
* @nested Any task performed at a relation table within a modal
|
|
22
25
|
*/
|
|
23
26
|
export interface iProperty<
|
|
24
27
|
T extends Record<string, any> = Record<string, any>,
|
|
@@ -28,6 +31,9 @@ export interface iProperty<
|
|
|
28
31
|
/**
|
|
29
32
|
* Function to create a node within the relation
|
|
30
33
|
* The parent is given since the node doesn't exist yet
|
|
34
|
+
*
|
|
35
|
+
* @action Showcases an button to create a new node/value within this property/relation
|
|
36
|
+
* @nested Passed down to the related table if any
|
|
31
37
|
*/
|
|
32
38
|
createNode?: iNodeFn<P, [P?]>;
|
|
33
39
|
/**
|
|
@@ -36,18 +42,28 @@ export interface iProperty<
|
|
|
36
42
|
disableCreateNode?: (p: P) => boolean;
|
|
37
43
|
/**
|
|
38
44
|
* Function to clone a node within the relation
|
|
45
|
+
* Set to false to omit cloning this property/relation
|
|
46
|
+
*
|
|
47
|
+
* @action No inline action
|
|
48
|
+
* @nested Passed down to the related table if any
|
|
39
49
|
*/
|
|
40
|
-
cloneNode?: iNodeFn<T, [T?]
|
|
50
|
+
cloneNode?: iNodeFn<T, [T?]> | false;
|
|
41
51
|
/**
|
|
42
52
|
* Function to update a node within the relation
|
|
53
|
+
*
|
|
54
|
+
* @action Showcases an button to update this node/value within this property/relation
|
|
55
|
+
* @nested Passed down to the related table if any
|
|
43
56
|
*/
|
|
44
57
|
updateNode?: iNodeFn<T, [T?, P?]>;
|
|
45
58
|
/**
|
|
46
59
|
* Function to delete a node within the relation
|
|
60
|
+
*
|
|
61
|
+
* @action No inline action
|
|
62
|
+
* @nested Passed down to the related table if any
|
|
47
63
|
*/
|
|
48
64
|
deleteNode?: iNodeFn<T, [T?]>;
|
|
49
65
|
/**
|
|
50
|
-
* Render using this component instead
|
|
66
|
+
* Render row cell (property) using this component instead
|
|
51
67
|
*/
|
|
52
68
|
component?: ComponentType;
|
|
53
69
|
/**
|