@open-xamu-co/ui-common-types 3.1.0-next.4 → 3.1.0-next.5
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 +1 -1
- package/src/locale.ts +26 -10
- package/src/plugin.ts +7 -0
- package/src/values.ts +15 -2
package/package.json
CHANGED
package/src/locale.ts
CHANGED
|
@@ -246,30 +246,46 @@ export type tLocaleTable = {
|
|
|
246
246
|
/** @example "Show all" */
|
|
247
247
|
table_show_all: string;
|
|
248
248
|
swal: {
|
|
249
|
-
/** @example "Are you sure you want to delete this
|
|
249
|
+
/** @example "Are you sure you want to delete this item?" */
|
|
250
250
|
table_delete_node_title: string;
|
|
251
|
-
/** @example "Remember that you wont be able to recover this
|
|
251
|
+
/** @example "Remember that you wont be able to recover this item data and you will lost all of your work" */
|
|
252
252
|
table_delete_node_disclaimer: string;
|
|
253
253
|
/** @example "Successfull deletion" */
|
|
254
254
|
table_deleted: string;
|
|
255
|
-
/** @example "
|
|
255
|
+
/** @example "The item was deleted, the list will refresh automatically" */
|
|
256
|
+
table_deleted_text: string;
|
|
257
|
+
/** @example "Are you sure you want to delete this item? | Are you sure you want to delete these {count} items?" */
|
|
256
258
|
table_delete_nodes_title: string;
|
|
257
|
-
/** @example "Remember that you wont be able to recover these
|
|
259
|
+
/** @example "Remember that you wont be able to recover these items data and you will lost all of your work" */
|
|
258
260
|
table_delete_nodes_disclaimer: string;
|
|
259
|
-
/** @example "
|
|
261
|
+
/** @example "Deletion went wrong" */
|
|
260
262
|
table_possibly_not_deleted: string;
|
|
263
|
+
/** @example "The item may not have been deleted | The items may not have been deleted" */
|
|
264
|
+
table_possibly_not_deleted_text: string;
|
|
261
265
|
/** @example "Successfull update" */
|
|
262
266
|
table_updated: string;
|
|
263
|
-
/** @example "The item
|
|
267
|
+
/** @example "The item was updated, the list will refresh automatically" */
|
|
268
|
+
table_updated_text: string;
|
|
269
|
+
/** @example "Update went wrong" */
|
|
264
270
|
table_possibly_not_updated: string;
|
|
265
|
-
/** @example "
|
|
271
|
+
/** @example "The item may not have been updated | The items may not have been updated" */
|
|
272
|
+
table_possibly_not_updated_text: string;
|
|
273
|
+
/** @example "Successfull creation" */
|
|
266
274
|
table_created: string;
|
|
267
|
-
/** @example "The item
|
|
275
|
+
/** @example "The item was created, you can already find it in the list" */
|
|
276
|
+
table_created_text: string;
|
|
277
|
+
/** @example "Creation went wrong" */
|
|
268
278
|
table_possibly_not_created: string;
|
|
269
|
-
/** @example "
|
|
279
|
+
/** @example "The item may not have been created | The items may not have been created" */
|
|
280
|
+
table_possibly_not_created_text: string;
|
|
281
|
+
/** @example "Successfull clonation" */
|
|
270
282
|
table_cloned: string;
|
|
271
|
-
/** @example "The item
|
|
283
|
+
/** @example "The item was cloned, you can already find it in the list" */
|
|
284
|
+
table_cloned_text: string;
|
|
285
|
+
/** @example "Clonation went wrong" */
|
|
272
286
|
table_possibly_not_cloned: string;
|
|
287
|
+
/** @example "The item may not have been cloned | The items may not have been cloned" */
|
|
288
|
+
table_possibly_not_cloned_text: string;
|
|
273
289
|
};
|
|
274
290
|
};
|
|
275
291
|
|
package/src/plugin.ts
CHANGED
|
@@ -146,4 +146,11 @@ export interface iPluginOptions<ComponentType = unknown> {
|
|
|
146
146
|
* @default console.log
|
|
147
147
|
*/
|
|
148
148
|
logger?: tLogger;
|
|
149
|
+
/**
|
|
150
|
+
* Function used to encode the pagination cursor
|
|
151
|
+
*
|
|
152
|
+
* @default node.id
|
|
153
|
+
*/
|
|
154
|
+
cursorEncoder?: (<T>(node: T) => string) | (<T>(node: T) => number);
|
|
155
|
+
internals?: Record<string, any>;
|
|
149
156
|
}
|
package/src/values.ts
CHANGED
|
@@ -6,16 +6,29 @@ export interface iSelectOption {
|
|
|
6
6
|
hidden?: boolean;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Response from node functions
|
|
11
|
+
*
|
|
12
|
+
* Action result, event and callback
|
|
13
|
+
*/
|
|
14
|
+
export type iNodeFnResponse<T extends Record<string, any> = never> = [
|
|
15
|
+
(boolean | T)?,
|
|
16
|
+
Event?,
|
|
17
|
+
(() => void)?,
|
|
18
|
+
];
|
|
10
19
|
|
|
11
20
|
/**
|
|
12
21
|
* Funtions that uses a node and perform some action
|
|
13
22
|
*
|
|
14
23
|
* Useful for table actions like creating, updating and deleting nodes
|
|
24
|
+
*
|
|
25
|
+
* Undefined would mean no action was performed
|
|
26
|
+
* True or an T type object would mean action was performed successfully
|
|
27
|
+
* False would mean action failed
|
|
15
28
|
*/
|
|
16
29
|
export type iNodeFn<T extends Record<string, any>, Ta extends [T?, ...any[]] = [T]> = (
|
|
17
30
|
...args: Ta
|
|
18
|
-
) => boolean | undefined | iNodeFnResponse | Promise<boolean | undefined | iNodeFnResponse
|
|
31
|
+
) => boolean | undefined | iNodeFnResponse<T> | Promise<boolean | undefined | iNodeFnResponse<T>>;
|
|
19
32
|
|
|
20
33
|
/**
|
|
21
34
|
* Used on Table and related components
|