@vanillabp/bc-shared 0.0.22 → 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.
@@ -1,8 +1,7 @@
1
1
  import { BoxExtendedProps, TextExtendedProps } from 'grommet';
2
2
  import { ColorType, BackgroundType } from 'grommet/utils/index.js';
3
3
  import React, { PropsWithChildren, FC } from 'react';
4
- import { ListItem, Column, Person } from '../types/ListCell.js';
5
- import { TranslationFunction } from '../types/translate.js';
4
+ import { ListItem, TranslationFunction, Column, Person } from '@vanillabp/bc-types';
6
5
 
7
6
  declare const ENDED_FONT_COLOR_ODD = "#b4b4b4";
8
7
  declare type Alignment = 'left' | 'center' | 'right';
@@ -6,7 +6,6 @@ import {
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { Box, Text } from "grommet";
8
8
  import { memo } from "react";
9
- import { ListItemStatus } from "../types/index.js";
10
9
  import {
11
10
  getObjectProperty,
12
11
  toLocaleDateString,
@@ -14,6 +13,7 @@ import {
14
13
  toLocaleTimeStringWithoutSeconds
15
14
  } from "../utils/index.js";
16
15
  import { UserDetailsBox } from "./index.js";
16
+ import { ListItemStatus } from "@vanillabp/bc-types";
17
17
  const DATE_REGEXP = /^(\d{4})-(\d{2})-(\d{2})/;
18
18
  const ENDED_FONT_COLOR_ODD = "#b4b4b4";
19
19
  const textColorAccordingToStatus = (item) => {
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
- import { Column } from '../types/ListCell.js';
2
+ import { Column } from '@vanillabp/bc-types';
3
3
 
4
4
  interface DefaultListHeaderProps<D> {
5
5
  column: Column;
@@ -55,7 +55,7 @@ const SseProvider = (_a) => {
55
55
  url,
56
56
  __spreadValues({
57
57
  // since we use locking fetch-api the server has to sent an
58
- // ping-message immediatelly, to make the client release the lock
58
+ // ping-message immediately, to make the client release the lock
59
59
  fetch: buildFetchApi(),
60
60
  headers: {
61
61
  "cache-control": "no-cache"
@@ -1,6 +1,5 @@
1
1
  import { Person } from '@vanillabp/bc-official-gui-client';
2
- import { Person as Person$1 } from '../types/ListCell.js';
3
- import { TranslationFunction } from '../types/translate.js';
2
+ import { TranslationFunction, Person as Person$1 } from '@vanillabp/bc-types';
4
3
 
5
4
  declare const UserDetailsBox: ({ t, user }: {
6
5
  t: TranslationFunction;
@@ -17,6 +17,5 @@ import 'grommet';
17
17
  import 'grommet/utils';
18
18
  import 'i18next';
19
19
  import 'grommet/utils/index.js';
20
- import '../types/ListCell.js';
21
- import '../types/translate.js';
20
+ import '@vanillabp/bc-types';
22
21
  import '@vanillabp/bc-official-gui-client';
package/dist/index.d.ts CHANGED
@@ -22,18 +22,14 @@ export { i18n } from './utils/i18n.js';
22
22
  export { theme } from './theme/index.js';
23
23
  export { UserTaskForm } from './types/UserTaskForm.js';
24
24
  export { ColumnsOfUserTaskFunction, UserTaskListCell } from './types/UserTaskListCell.js';
25
- export { Column, ColumnType, ListItem, ListItemStatus, Person } from './types/ListCell.js';
26
25
  export { WorkflowPage } from './types/WorkflowPage.js';
27
26
  export { ColumnsOfWorkflowFunction, WorkflowListCell } from './types/WorkflowListCell.js';
28
- export { BcWorkflow, GetUserTasksFunction, NavigateToWorkflowFunction } from './types/BcWorkflow.js';
29
- export { AssignFunction, BcUserTask, ClaimFunction, OpenUserTaskFunction, OpenWorkflowFunction, UnassignFunction, UnclaimFunction } from './types/BcUserTask.js';
30
- export { BcWorkflowModule } from './types/BcWorkflowModule.js';
31
27
  export { WorkflowModule, WorkflowModuleComponent, WorkflowModuleComponentProps } from './types/WorkflowModuleComponent.js';
32
- export { TranslationFunction } from './types/translate.js';
33
28
  import '@microsoft/fetch-event-source';
34
29
  import 'react';
35
30
  import 'grommet';
36
31
  import 'grommet/utils';
37
32
  import 'i18next';
38
33
  import 'grommet/utils/index.js';
34
+ import '@vanillabp/bc-types';
39
35
  import '@vanillabp/bc-official-gui-client';
@@ -1,6 +1,5 @@
1
1
  import { FC } from 'react';
2
- import { BcUserTask } from './BcUserTask.js';
3
- import '@vanillabp/bc-official-gui-client';
2
+ import { BcUserTask } from '@vanillabp/bc-types';
4
3
 
5
4
  interface UserTaskFormProps {
6
5
  userTask: BcUserTask;
@@ -1,11 +1,9 @@
1
1
  import { FC } from 'react';
2
2
  import { UserTask } from '@vanillabp/bc-official-gui-client';
3
- import { BcUserTask } from './BcUserTask.js';
4
- import { Column } from './ListCell.js';
5
3
  import { DefaultListCellAwareProps } from '../components/DefaultListCell.js';
4
+ import { Column, BcUserTask } from '@vanillabp/bc-types';
6
5
  import 'grommet';
7
6
  import 'grommet/utils/index.js';
8
- import './translate.js';
9
7
 
10
8
  interface UserTaskListCellProps extends DefaultListCellAwareProps<BcUserTask> {
11
9
  }
@@ -1,12 +1,9 @@
1
1
  import { FC } from 'react';
2
2
  import { Workflow } from '@vanillabp/bc-official-gui-client';
3
3
  import { DefaultListCellAwareProps } from '../components/DefaultListCell.js';
4
- import { Column } from './ListCell.js';
5
- import { BcWorkflow } from './BcWorkflow.js';
4
+ import { Column, BcWorkflow } from '@vanillabp/bc-types';
6
5
  import 'grommet';
7
6
  import 'grommet/utils/index.js';
8
- import './translate.js';
9
- import './BcUserTask.js';
10
7
 
11
8
  interface WorkflowCellProps extends DefaultListCellAwareProps<BcWorkflow> {
12
9
  }
@@ -1,7 +1,5 @@
1
1
  import { FC } from 'react';
2
- import { BcWorkflow } from './BcWorkflow.js';
3
- import '@vanillabp/bc-official-gui-client';
4
- import './BcUserTask.js';
2
+ import { BcWorkflow } from '@vanillabp/bc-types';
5
3
 
6
4
  interface WorkflowPageProps {
7
5
  workflow: BcWorkflow;
@@ -1,14 +1,10 @@
1
1
  export { UserTaskForm } from './UserTaskForm.js';
2
2
  export { ColumnsOfUserTaskFunction, UserTaskListCell } from './UserTaskListCell.js';
3
- export { Column, ColumnType, ListItem, ListItemStatus, Person } from './ListCell.js';
4
3
  export { WorkflowPage } from './WorkflowPage.js';
5
4
  export { ColumnsOfWorkflowFunction, WorkflowListCell } from './WorkflowListCell.js';
6
- export { BcWorkflow, GetUserTasksFunction, NavigateToWorkflowFunction } from './BcWorkflow.js';
7
- export { AssignFunction, BcUserTask, ClaimFunction, OpenUserTaskFunction, OpenWorkflowFunction, UnassignFunction, UnclaimFunction } from './BcUserTask.js';
8
- export { BcWorkflowModule } from './BcWorkflowModule.js';
9
5
  export { WorkflowModule, WorkflowModuleComponent, WorkflowModuleComponentProps } from './WorkflowModuleComponent.js';
10
- export { TranslationFunction } from './translate.js';
11
6
  import 'react';
7
+ import '@vanillabp/bc-types';
12
8
  import '@vanillabp/bc-official-gui-client';
13
9
  import '../components/DefaultListCell.js';
14
10
  import 'grommet';
@@ -1,10 +1,5 @@
1
1
  export * from "./UserTaskForm.js";
2
2
  export * from "./UserTaskListCell.js";
3
- export * from "./ListCell.js";
4
3
  export * from "./WorkflowPage.js";
5
4
  export * from "./WorkflowListCell.js";
6
- export * from "./BcWorkflow.js";
7
- export * from "./BcUserTask.js";
8
- export * from "./BcWorkflowModule.js";
9
5
  export * from "./WorkflowModuleComponent.js";
10
- export * from "./translate.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vanillabp/bc-shared",
3
- "version": "0.0.22",
3
+ "version": "0.1.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/vanillabp/business-cockpit.git"
@@ -17,7 +17,8 @@
17
17
  ],
18
18
  "dependencies": {
19
19
  "@microsoft/fetch-event-source": "2.0.1",
20
- "@vanillabp/bc-official-gui-client": "0.0.22",
20
+ "@vanillabp/bc-official-gui-client": "0.1.1",
21
+ "@vanillabp/bc-types": "0.1.1",
21
22
  "react-cookie": "4.1.1",
22
23
  "usehooks-ts": "2.7.1"
23
24
  },
@@ -1,18 +0,0 @@
1
- import { UserTask } from '@vanillabp/bc-official-gui-client';
2
-
3
- declare type OpenUserTaskFunction = () => void;
4
- declare type OpenWorkflowFunction = () => void;
5
- declare type AssignFunction = (userId: string) => void;
6
- declare type UnassignFunction = (userId: string) => void;
7
- declare type ClaimFunction = () => void;
8
- declare 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
- export { AssignFunction, BcUserTask, ClaimFunction, OpenUserTaskFunction, OpenWorkflowFunction, UnassignFunction, UnclaimFunction };
@@ -1 +0,0 @@
1
- ;
@@ -1,11 +0,0 @@
1
- import { Workflow } from '@vanillabp/bc-official-gui-client';
2
- import { BcUserTask } from './BcUserTask.js';
3
-
4
- declare type GetUserTasksFunction = (activeOnly: boolean, limitListAccordingToCurrentUsersPermissions: boolean) => Promise<Array<BcUserTask>>;
5
- declare type NavigateToWorkflowFunction = () => void;
6
- interface BcWorkflow extends Workflow {
7
- navigateToWorkflow: NavigateToWorkflowFunction;
8
- getUserTasks: GetUserTasksFunction;
9
- }
10
-
11
- export { BcWorkflow, GetUserTasksFunction, NavigateToWorkflowFunction };
@@ -1 +0,0 @@
1
- ;
@@ -1,30 +0,0 @@
1
- import { UiUriType } from '@vanillabp/bc-official-gui-client';
2
-
3
- interface BcWorkflowModule {
4
- /**
5
- * The workflow module of this usertask
6
- * @type {string}
7
- * @memberof UserTask
8
- */
9
- workflowModuleId: string;
10
- /**
11
- * 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)
12
- * @type {string}
13
- * @memberof UserTask
14
- */
15
- uiUri: string;
16
- /**
17
- *
18
- * @type {UiUriType}
19
- * @memberof UserTask
20
- */
21
- uiUriType: UiUriType;
22
- /**
23
- * An URI pointing to the workflow-module's own API (maybe used by user-task forms)
24
- * @type {string}
25
- * @memberof UserTask
26
- */
27
- workflowModuleUri: string;
28
- }
29
-
30
- export { BcWorkflowModule };
File without changes
@@ -1,43 +0,0 @@
1
- interface Title {
2
- [key: string]: string;
3
- }
4
- declare type ColumnType = 'value' | 'i18n' | 'person' | 'date' | 'date-time' | 'time';
5
- interface Column {
6
- title: Title;
7
- path: string;
8
- type?: ColumnType;
9
- priority: number;
10
- width: string;
11
- show: boolean;
12
- sortable: boolean;
13
- filterable: boolean;
14
- resizeable: boolean;
15
- exportable?: boolean;
16
- }
17
- interface Person {
18
- id: string;
19
- display?: string;
20
- displayShort?: string;
21
- email?: string;
22
- avatar?: number;
23
- details?: {
24
- [key: string]: any;
25
- };
26
- }
27
- declare enum ListItemStatus {
28
- INITIAL = 0,
29
- NEW = 1,
30
- UPDATED = 2,
31
- ENDED = 3,
32
- REMOVED_FROM_LIST = 4
33
- }
34
- interface ListItem<D> {
35
- id: string;
36
- number: number;
37
- data: D;
38
- status: ListItemStatus;
39
- selected: boolean;
40
- read?: Date;
41
- }
42
-
43
- export { Column, ColumnType, ListItem, ListItemStatus, Person };
@@ -1,14 +0,0 @@
1
- import "../chunk-YH4NJHER.js";
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
- ;
11
- ;
12
- export {
13
- ListItemStatus
14
- };
@@ -1,3 +0,0 @@
1
- declare type TranslationFunction = (key: string) => string;
2
-
3
- export { TranslationFunction };
File without changes