@vanillabp/bc-types 0.1.1
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/dist/index.d.ts +115 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/package.json +47 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { UserTask, Workflow, UiUriType } from '@vanillabp/bc-official-gui-client';
|
|
2
|
+
|
|
3
|
+
type OpenUserTaskFunction = () => void;
|
|
4
|
+
type OpenWorkflowFunction = () => void;
|
|
5
|
+
type AssignFunction = (userId: string) => void;
|
|
6
|
+
type UnassignFunction = (userId: string) => void;
|
|
7
|
+
type ClaimFunction = () => void;
|
|
8
|
+
type UnclaimFunction = () => void;
|
|
9
|
+
interface BcUserTask extends UserTask {
|
|
10
|
+
open: OpenUserTaskFunction;
|
|
11
|
+
navigateToWorkflow: OpenWorkflowFunction;
|
|
12
|
+
assign: AssignFunction;
|
|
13
|
+
unassign: UnassignFunction;
|
|
14
|
+
claim: ClaimFunction;
|
|
15
|
+
unclaim: UnclaimFunction;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type BcUserTasksProvider = (activeOnly: boolean, limitListAccordingToCurrentUsersPermissions: boolean) => Promise<Array<BcUserTask>>;
|
|
19
|
+
|
|
20
|
+
interface BcWorkflow extends Workflow {
|
|
21
|
+
navigateToWorkflow: () => void;
|
|
22
|
+
getUserTasks: BcUserTasksProvider;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface BcWorkflowModule {
|
|
26
|
+
/**
|
|
27
|
+
* The workflow module of this usertask
|
|
28
|
+
* @type {string}
|
|
29
|
+
* @memberof UserTask
|
|
30
|
+
*/
|
|
31
|
+
workflowModuleId: string;
|
|
32
|
+
/**
|
|
33
|
+
* An URI as an entrypoint URI for UI components. Maybe a technical URL (e.g. for WEBPACK) or an URL targeting a human readable form (e.g. EXTERNAL)
|
|
34
|
+
* @type {string}
|
|
35
|
+
* @memberof UserTask
|
|
36
|
+
*/
|
|
37
|
+
uiUri: string;
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @type {UiUriType}
|
|
41
|
+
* @memberof UserTask
|
|
42
|
+
*/
|
|
43
|
+
uiUriType: UiUriType;
|
|
44
|
+
/**
|
|
45
|
+
* An URI pointing to the workflow-module's own API (maybe used by user-task forms)
|
|
46
|
+
* @type {string}
|
|
47
|
+
* @memberof UserTask
|
|
48
|
+
*/
|
|
49
|
+
workflowModuleUri: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* A map of language codes to their corresponding translated strings.
|
|
54
|
+
* The keys are language identifiers (e.g., 'en', 'de'),
|
|
55
|
+
* and the values are the translated versions of the same content.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
*
|
|
59
|
+
* const title: Translatable = {
|
|
60
|
+
* en: "Hello",
|
|
61
|
+
* de: "Hallo",
|
|
62
|
+
* };
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
65
|
+
interface Translatable {
|
|
66
|
+
[languageKey: string]: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
interface Column {
|
|
70
|
+
title: Translatable;
|
|
71
|
+
path: string;
|
|
72
|
+
type?: 'value' | 'i18n' | 'person' | 'date' | 'date-time' | 'time';
|
|
73
|
+
priority: number;
|
|
74
|
+
width: string;
|
|
75
|
+
show: boolean;
|
|
76
|
+
sortable: boolean;
|
|
77
|
+
filterable: boolean;
|
|
78
|
+
resizeable: boolean;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
type ColumnsOfUserTaskFunction = (userTask: UserTask) => Column[] | undefined;
|
|
82
|
+
|
|
83
|
+
type ColumnsOfWorkflowFunction = (workflow: Workflow) => Column[] | undefined;
|
|
84
|
+
|
|
85
|
+
type TranslationFunction = (key: string) => string;
|
|
86
|
+
|
|
87
|
+
declare enum ListItemStatus {
|
|
88
|
+
INITIAL = 0,
|
|
89
|
+
NEW = 1,
|
|
90
|
+
UPDATED = 2,
|
|
91
|
+
ENDED = 3,
|
|
92
|
+
REMOVED_FROM_LIST = 4
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
interface ListItem<T> {
|
|
96
|
+
id: string;
|
|
97
|
+
number: number;
|
|
98
|
+
data: T;
|
|
99
|
+
status: ListItemStatus;
|
|
100
|
+
selected: boolean;
|
|
101
|
+
read?: Date;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface Person {
|
|
105
|
+
id: string;
|
|
106
|
+
display?: string;
|
|
107
|
+
displayShort?: string;
|
|
108
|
+
email?: string;
|
|
109
|
+
avatar?: number;
|
|
110
|
+
details?: {
|
|
111
|
+
[key: string]: unknown;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export { type AssignFunction, type BcUserTask, type BcUserTasksProvider, type BcWorkflow, type BcWorkflowModule, type ClaimFunction, type Column, type ColumnsOfUserTaskFunction, type ColumnsOfWorkflowFunction, type ListItem, ListItemStatus, type OpenUserTaskFunction, type OpenWorkflowFunction, type Person, type Translatable, type TranslationFunction, type UnassignFunction, type UnclaimFunction };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/list/list-item-status.ts
|
|
2
|
+
var ListItemStatus = /* @__PURE__ */ ((ListItemStatus2) => {
|
|
3
|
+
ListItemStatus2[ListItemStatus2["INITIAL"] = 0] = "INITIAL";
|
|
4
|
+
ListItemStatus2[ListItemStatus2["NEW"] = 1] = "NEW";
|
|
5
|
+
ListItemStatus2[ListItemStatus2["UPDATED"] = 2] = "UPDATED";
|
|
6
|
+
ListItemStatus2[ListItemStatus2["ENDED"] = 3] = "ENDED";
|
|
7
|
+
ListItemStatus2[ListItemStatus2["REMOVED_FROM_LIST"] = 4] = "REMOVED_FROM_LIST";
|
|
8
|
+
return ListItemStatus2;
|
|
9
|
+
})(ListItemStatus || {});
|
|
10
|
+
export {
|
|
11
|
+
ListItemStatus
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/list/list-item-status.ts"],"sourcesContent":["export enum ListItemStatus {\n INITIAL,\n NEW,\n UPDATED,\n ENDED,\n REMOVED_FROM_LIST,\n}\n"],"mappings":";AAAO,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gCAAA;AACA,EAAAA,gCAAA;AACA,EAAAA,gCAAA;AACA,EAAAA,gCAAA;AACA,EAAAA,gCAAA;AALU,SAAAA;AAAA,GAAA;","names":["ListItemStatus"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vanillabp/bc-types",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Library providing shared types for VanillaBP UI development",
|
|
5
|
+
"author": "Phactum Softwareentwicklung GmbH",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/vanillabp/business-cockpit.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/vanillabp/business-cockpit",
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"type": "module",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"module": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"package.json"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"format": "prettier --write .",
|
|
27
|
+
"lint": "eslint .",
|
|
28
|
+
"build": "tsup",
|
|
29
|
+
"typecheck": "tsc --noEmit",
|
|
30
|
+
"unpublish:snapshot": "npm unpublish --force",
|
|
31
|
+
"publish:snapshot": "npm publish --tag snapshot",
|
|
32
|
+
"version:snapshot": "npm version ${npm_config_newversion} --no-git-tag-version",
|
|
33
|
+
"publish:release": "npm publish --access public"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "8.53.1",
|
|
37
|
+
"@typescript-eslint/parser": "8.53.1",
|
|
38
|
+
"eslint": "9.39.2",
|
|
39
|
+
"eslint-config-prettier": "10.1.8",
|
|
40
|
+
"prettier": "3.8.0",
|
|
41
|
+
"tsup": "8.5.1",
|
|
42
|
+
"typescript": "5.9.3"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"@vanillabp/bc-official-gui-client": "0.1.1"
|
|
46
|
+
}
|
|
47
|
+
}
|