andoncloud-workplaces-state-timelines-widget 1.0.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/README.md +21 -0
- package/dist/components/Loading/index.d.ts +3 -0
- package/dist/components/SettingsForm/index.d.ts +4 -0
- package/dist/components/Timeline/index.d.ts +9 -0
- package/dist/components/Timeline/styled.d.ts +10 -0
- package/dist/components/TimelineLoader/index.d.ts +3 -0
- package/dist/components/Widget/index.d.ts +4 -0
- package/dist/components/WidgetSettings/index.d.ts +4 -0
- package/dist/components/WidgetView/index.d.ts +4 -0
- package/dist/helpers.d.ts +3 -0
- package/dist/i18n.d.ts +2 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +28168 -0
- package/dist/index.js.map +1 -0
- package/dist/stories/Widget.stories.d.ts +3 -0
- package/dist/types.d.ts +36 -0
- package/dist/utils/graphql-sdk.d.ts +142 -0
- package/package.json +71 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, import("../types").WidgetProps>;
|
|
2
|
+
export default _default;
|
|
3
|
+
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, import("../types").WidgetProps>;
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StatusChange, Workplace } from 'andoncloud-dashboard-toolkit';
|
|
3
|
+
export interface WidgetSettings {
|
|
4
|
+
workplacesIds: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface WidgetViewProps {
|
|
7
|
+
data: {
|
|
8
|
+
workplaces: Workplace[];
|
|
9
|
+
statusChanges: StatusChange[];
|
|
10
|
+
};
|
|
11
|
+
settings?: WidgetSettings;
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface WidgetSettingsProps {
|
|
15
|
+
data: {
|
|
16
|
+
workplaces: Workplace[];
|
|
17
|
+
};
|
|
18
|
+
settings?: WidgetSettings;
|
|
19
|
+
onCancel: () => void;
|
|
20
|
+
onChange: (settings: WidgetSettings) => void;
|
|
21
|
+
}
|
|
22
|
+
export interface SettingsFormProps extends Omit<React.FormHTMLAttributes<HTMLFormElement>, 'onSubmit'> {
|
|
23
|
+
data: WidgetSettingsProps['data'];
|
|
24
|
+
settings?: WidgetSettings;
|
|
25
|
+
onCancel: () => void;
|
|
26
|
+
onSubmit: (settings: WidgetSettings) => void;
|
|
27
|
+
}
|
|
28
|
+
export declare type WidgetData = WidgetViewProps['data'] & SettingsFormProps['data'];
|
|
29
|
+
export interface WidgetProps {
|
|
30
|
+
id: string;
|
|
31
|
+
url: string;
|
|
32
|
+
token: string;
|
|
33
|
+
lang: 'en' | 'pl';
|
|
34
|
+
data?: WidgetData;
|
|
35
|
+
editMode?: boolean;
|
|
36
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
declare const _default: (url: string, token: string) => {
|
|
2
|
+
createDashboard(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
gridLayout?: string | null | undefined;
|
|
6
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").CreateDashboardMutation>;
|
|
7
|
+
createOrder(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
8
|
+
id: string;
|
|
9
|
+
number: string;
|
|
10
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").CreateOrderMutation>;
|
|
11
|
+
createProduct(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
12
|
+
id: string;
|
|
13
|
+
name?: string | null | undefined;
|
|
14
|
+
number: string;
|
|
15
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").CreateProductMutation>;
|
|
16
|
+
createStatusChange(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
17
|
+
id: string;
|
|
18
|
+
userId?: string | null | undefined;
|
|
19
|
+
reasonId: string;
|
|
20
|
+
workplaceId: string;
|
|
21
|
+
startedAt?: string | null | undefined;
|
|
22
|
+
note?: string | null | undefined;
|
|
23
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").CreateStatusChangeMutation>;
|
|
24
|
+
createUserPresence(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
25
|
+
id: string;
|
|
26
|
+
workplaceId: string;
|
|
27
|
+
userToken: string;
|
|
28
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").CreateUserPresenceMutation>;
|
|
29
|
+
createWidget(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
30
|
+
id: string;
|
|
31
|
+
config?: string | null | undefined;
|
|
32
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").CreateWidgetMutation>;
|
|
33
|
+
pauseOrderExecution(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
34
|
+
id: string;
|
|
35
|
+
statusChangeId: string;
|
|
36
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").PauseOrderExecutionMutation>;
|
|
37
|
+
removeDashboard(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
38
|
+
id: string;
|
|
39
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").RemoveDashboardMutation>;
|
|
40
|
+
removeUserPresence(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
41
|
+
id: string;
|
|
42
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").RemoveUserPresenceMutation>;
|
|
43
|
+
removeWidget(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
44
|
+
id: string;
|
|
45
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").RemoveWidgetMutation>;
|
|
46
|
+
removeWorkplaceUsersPresences(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
47
|
+
workplaceId: string;
|
|
48
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").RemoveWorkplaceUsersPresencesMutation>;
|
|
49
|
+
setCounter(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
50
|
+
id: string;
|
|
51
|
+
value: number;
|
|
52
|
+
note?: string | null | undefined;
|
|
53
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").SetCounterMutation>;
|
|
54
|
+
startOrderExecution(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
55
|
+
id: string;
|
|
56
|
+
workplaceId: string;
|
|
57
|
+
orderId: string;
|
|
58
|
+
productId?: string | null | undefined;
|
|
59
|
+
statusChangeId: string;
|
|
60
|
+
quantity?: number | null | undefined;
|
|
61
|
+
note?: string | null | undefined;
|
|
62
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").StartOrderExecutionMutation>;
|
|
63
|
+
stopOrderExecution(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
64
|
+
id: string;
|
|
65
|
+
statusChangeId: string;
|
|
66
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").StopOrderExecutionMutation>;
|
|
67
|
+
updateDashboard(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
68
|
+
id: string;
|
|
69
|
+
name?: string | null | undefined;
|
|
70
|
+
gridLayout: string;
|
|
71
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").UpdateDashboardMutation>;
|
|
72
|
+
updateOrderExecution(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
73
|
+
id: string;
|
|
74
|
+
standardRateId: string;
|
|
75
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").UpdateOrderExecutionMutation>;
|
|
76
|
+
updateWidget(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
77
|
+
id: string;
|
|
78
|
+
config: string;
|
|
79
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").UpdateWidgetMutation>;
|
|
80
|
+
companyConfig(variables?: import("andoncloud-dashboard-toolkit").Exact<{
|
|
81
|
+
[key: string]: never;
|
|
82
|
+
}> | undefined, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").CompanyConfigQuery>;
|
|
83
|
+
counterDirectories(variables?: import("andoncloud-dashboard-toolkit").Exact<{
|
|
84
|
+
[key: string]: never;
|
|
85
|
+
}> | undefined, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").CounterDirectoriesQuery>;
|
|
86
|
+
counters(variables?: import("andoncloud-dashboard-toolkit").Exact<{
|
|
87
|
+
[key: string]: never;
|
|
88
|
+
}> | undefined, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").CountersQuery>;
|
|
89
|
+
currentUser(variables?: import("andoncloud-dashboard-toolkit").Exact<{
|
|
90
|
+
[key: string]: never;
|
|
91
|
+
}> | undefined, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").CurrentUserQuery>;
|
|
92
|
+
dashboards(variables?: import("andoncloud-dashboard-toolkit").Exact<{
|
|
93
|
+
[key: string]: never;
|
|
94
|
+
}> | undefined, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").DashboardsQuery>;
|
|
95
|
+
metricValues(variables?: import("andoncloud-dashboard-toolkit").Exact<{
|
|
96
|
+
workplaceIds?: string | string[] | null | undefined;
|
|
97
|
+
metricIds?: string | string[] | null | undefined;
|
|
98
|
+
}> | undefined, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").MetricValuesQuery>;
|
|
99
|
+
metrics(variables?: import("andoncloud-dashboard-toolkit").Exact<{
|
|
100
|
+
[key: string]: never;
|
|
101
|
+
}> | undefined, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").MetricsQuery>;
|
|
102
|
+
orders(variables?: import("andoncloud-dashboard-toolkit").Exact<{
|
|
103
|
+
[key: string]: never;
|
|
104
|
+
}> | undefined, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").OrdersQuery>;
|
|
105
|
+
ordersExecutions(variables?: import("andoncloud-dashboard-toolkit").Exact<{
|
|
106
|
+
[key: string]: never;
|
|
107
|
+
}> | undefined, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").OrdersExecutionsQuery>;
|
|
108
|
+
products(variables?: import("andoncloud-dashboard-toolkit").Exact<{
|
|
109
|
+
[key: string]: never;
|
|
110
|
+
}> | undefined, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").ProductsQuery>;
|
|
111
|
+
reasons(variables?: import("andoncloud-dashboard-toolkit").Exact<{
|
|
112
|
+
[key: string]: never;
|
|
113
|
+
}> | undefined, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").ReasonsQuery>;
|
|
114
|
+
shifts(variables?: import("andoncloud-dashboard-toolkit").Exact<{
|
|
115
|
+
[key: string]: never;
|
|
116
|
+
}> | undefined, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").ShiftsQuery>;
|
|
117
|
+
standardRates(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
118
|
+
orderExecutionId: string;
|
|
119
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").StandardRatesQuery>;
|
|
120
|
+
statusChangeTransitionPermissions(variables?: import("andoncloud-dashboard-toolkit").Exact<{
|
|
121
|
+
[key: string]: never;
|
|
122
|
+
}> | undefined, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").StatusChangeTransitionPermissionsQuery>;
|
|
123
|
+
statusChanges(variables?: import("andoncloud-dashboard-toolkit").Exact<{
|
|
124
|
+
[key: string]: never;
|
|
125
|
+
}> | undefined, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").StatusChangesQuery>;
|
|
126
|
+
users(variables?: import("andoncloud-dashboard-toolkit").Exact<{
|
|
127
|
+
[key: string]: never;
|
|
128
|
+
}> | undefined, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").UsersQuery>;
|
|
129
|
+
usersPresences(variables?: import("andoncloud-dashboard-toolkit").Exact<{
|
|
130
|
+
[key: string]: never;
|
|
131
|
+
}> | undefined, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").UsersPresencesQuery>;
|
|
132
|
+
widget(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
133
|
+
id: string;
|
|
134
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").WidgetQuery>;
|
|
135
|
+
workplaces(variables?: import("andoncloud-dashboard-toolkit").Exact<{
|
|
136
|
+
[key: string]: never;
|
|
137
|
+
}> | undefined, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").WorkplacesQuery>;
|
|
138
|
+
workplaceEvent(variables: import("andoncloud-dashboard-toolkit").Exact<{
|
|
139
|
+
id: string;
|
|
140
|
+
}>, requestHeaders?: import("graphql-request/dist/types.dom").Headers | string[][] | Record<string, string> | undefined): Promise<import("andoncloud-dashboard-toolkit").WorkplaceEventSubscription>;
|
|
141
|
+
};
|
|
142
|
+
export default _default;
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "andoncloud-workplaces-state-timelines-widget",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Made with create-andoncloud-widget",
|
|
5
|
+
"author": "Adrian Olszewski",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
|
+
"source": "src/index.tsx",
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=10"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"copy": "copyfiles -f src/images/* dist/images",
|
|
15
|
+
"build": "microbundle-crl --external=react-dom,react-is,@emotion/react,@emotion/styled,@mui/icons-material,@mui/lab,@mui/material,.*/images/.* --no-compress --format cjs && npm run copy",
|
|
16
|
+
"start": "microbundle-crl --external=react-dom,react-is,@emotion/react,@emotion/styled,@mui/icons-material,@mui/lab,@mui/material,.*/images/.* watch --no-compress --format cjs",
|
|
17
|
+
"start:example": "cd example && npm run start",
|
|
18
|
+
"start:dev": "run-p start start:example",
|
|
19
|
+
"prepare": "run-s build",
|
|
20
|
+
"lint": "eslint --ext .ts,.tsx --quiet --fix .",
|
|
21
|
+
"lint:ci": "eslint --ext .ts,.tsx --quiet .",
|
|
22
|
+
"i18n:extract": "i18next src/components/**/*.tsx [-oc]",
|
|
23
|
+
"predeploy": "cd example && npm install && npm run build",
|
|
24
|
+
"deploy": "gh-pages -d example/build"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"react": "^18.1.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@emotion/react": "^11.9.0",
|
|
31
|
+
"@emotion/styled": "^11.8.1",
|
|
32
|
+
"@types/node": "^17.0.31",
|
|
33
|
+
"@types/react": "^18.0.8",
|
|
34
|
+
"@types/react-dom": "^18.0.3",
|
|
35
|
+
"babel-eslint": "^10.0.3",
|
|
36
|
+
"copyfiles": "^2.4.1",
|
|
37
|
+
"cross-env": "^7.0.3",
|
|
38
|
+
"eslint": "^8.14.0",
|
|
39
|
+
"eslint-config-prettier": "^8.5.0",
|
|
40
|
+
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
41
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
42
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
43
|
+
"eslint-plugin-replace-relative-paths": "^0.1.1",
|
|
44
|
+
"eslint-plugin-simple-import-sort": "^7.0.0",
|
|
45
|
+
"gh-pages": "^3.2.3",
|
|
46
|
+
"i18next-parser": "^6.4.0",
|
|
47
|
+
"microbundle-crl": "^0.13.11",
|
|
48
|
+
"npm-run-all": "^4.1.5",
|
|
49
|
+
"prettier": "^2.6.2",
|
|
50
|
+
"react": "^18.1.0",
|
|
51
|
+
"react-dom": "^18.1.0",
|
|
52
|
+
"react-scripts": "^5.0.1",
|
|
53
|
+
"typescript": "^4.6.4"
|
|
54
|
+
},
|
|
55
|
+
"files": [
|
|
56
|
+
"dist",
|
|
57
|
+
"src/images"
|
|
58
|
+
],
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@mui/icons-material": "^5.6.2",
|
|
61
|
+
"@mui/lab": "^5.0.0-alpha.80",
|
|
62
|
+
"@mui/material": "^5.6.4",
|
|
63
|
+
"@storybook/react": "^6.4.22",
|
|
64
|
+
"andoncloud-dashboard-toolkit": "^1.1.2",
|
|
65
|
+
"graphql-request": "^4.2.0",
|
|
66
|
+
"i18next": "^21.6.16",
|
|
67
|
+
"moment": "^2.29.3",
|
|
68
|
+
"react-content-loader": "^6.2.0",
|
|
69
|
+
"react-i18next": "^11.16.7"
|
|
70
|
+
}
|
|
71
|
+
}
|