@operato/board 0.2.48 → 0.2.52
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/CHANGELOG.md +40 -0
- package/assets/images/components/audio.png +0 -0
- package/assets/images/components/both-arrow.png +0 -0
- package/assets/images/components/color-image.png +0 -0
- package/assets/images/components/container.png +0 -0
- package/assets/images/components/dash.png +0 -0
- package/assets/images/components/donut.png +0 -0
- package/assets/images/components/ellipse.png +0 -0
- package/assets/images/components/forklift.png +0 -0
- package/assets/images/components/gif-image.png +0 -0
- package/assets/images/components/global-reference.png +0 -0
- package/assets/images/components/gray-image.png +0 -0
- package/assets/images/components/humidity-sensor.png +0 -0
- package/assets/images/components/info-window.png +0 -0
- package/assets/images/components/line.png +0 -0
- package/assets/images/components/local-reference.png +0 -0
- package/assets/images/components/person.png +0 -0
- package/assets/images/components/polygon.png +0 -0
- package/assets/images/components/polyline.png +0 -0
- package/assets/images/components/popup.png +0 -0
- package/assets/images/components/rect.png +0 -0
- package/assets/images/components/single-arrow.png +0 -0
- package/assets/images/components/star.png +0 -0
- package/assets/images/components/text.png +0 -0
- package/assets/images/components/triangle.png +0 -0
- package/assets/images/icon-vtoolbar.png +0 -0
- package/custom-elements.json +1900 -743
- package/dist/src/component/3d.d.ts +2 -0
- package/dist/src/component/3d.js +27 -0
- package/dist/src/component/3d.js.map +1 -0
- package/dist/src/component/chart-and-gauge.d.ts +2 -0
- package/dist/src/component/chart-and-gauge.js +26 -0
- package/dist/src/component/chart-and-gauge.js.map +1 -0
- package/dist/src/component/container.d.ts +2 -0
- package/dist/src/component/container.js +60 -0
- package/dist/src/component/container.js.map +1 -0
- package/dist/src/component/data-source.d.ts +2 -0
- package/dist/src/component/data-source.js +28 -0
- package/dist/src/component/data-source.js.map +1 -0
- package/dist/src/component/etc.d.ts +2 -0
- package/dist/src/component/etc.js +82 -0
- package/dist/src/component/etc.js.map +1 -0
- package/dist/src/component/form.d.ts +2 -0
- package/dist/src/component/form.js +40 -0
- package/dist/src/component/form.js.map +1 -0
- package/dist/src/component/index.d.ts +12 -0
- package/dist/src/component/index.js +13 -0
- package/dist/src/component/index.js.map +1 -0
- package/dist/src/component/iot.d.ts +2 -0
- package/dist/src/component/iot.js +50 -0
- package/dist/src/component/iot.js.map +1 -0
- package/dist/src/component/line.d.ts +2 -0
- package/dist/src/component/line.js +130 -0
- package/dist/src/component/line.js.map +1 -0
- package/dist/src/component/register-default-groups.d.ts +1 -0
- package/dist/src/component/register-default-groups.js +28 -0
- package/dist/src/component/register-default-groups.js.map +1 -0
- package/dist/src/component/shape.d.ts +2 -0
- package/dist/src/component/shape.js +152 -0
- package/dist/src/component/shape.js.map +1 -0
- package/dist/src/component/table.d.ts +2 -0
- package/dist/src/component/table.js +26 -0
- package/dist/src/component/table.js.map +1 -0
- package/dist/src/component/text-and-media.d.ts +2 -0
- package/dist/src/component/text-and-media.js +122 -0
- package/dist/src/component/text-and-media.js.map +1 -0
- package/dist/src/component/warehouse.d.ts +2 -0
- package/dist/src/component/warehouse.js +24 -0
- package/dist/src/component/warehouse.js.map +1 -0
- package/dist/src/graphql/board.d.ts +6 -0
- package/dist/src/graphql/board.js +130 -0
- package/dist/src/graphql/board.js.map +1 -0
- package/dist/src/graphql/favorite-board.d.ts +1 -0
- package/dist/src/graphql/favorite-board.js +23 -0
- package/dist/src/graphql/favorite-board.js.map +1 -0
- package/dist/src/graphql/group.d.ts +7 -0
- package/dist/src/graphql/group.js +125 -0
- package/dist/src/graphql/group.js.map +1 -0
- package/dist/src/graphql/index.d.ts +4 -0
- package/dist/src/graphql/index.js +5 -0
- package/dist/src/graphql/index.js.map +1 -0
- package/dist/src/graphql/play-group.d.ts +8 -0
- package/dist/src/graphql/play-group.js +173 -0
- package/dist/src/graphql/play-group.js.map +1 -0
- package/dist/src/modeller/component-toolbar/component-detail.d.ts +1 -1
- package/dist/src/modeller/component-toolbar/component-detail.js +6 -6
- package/dist/src/modeller/component-toolbar/component-detail.js.map +1 -1
- package/dist/src/modeller/component-toolbar/component-menu.js +1 -2
- package/dist/src/modeller/component-toolbar/component-menu.js.map +1 -1
- package/dist/src/modeller/component-toolbar/component-toolbar.js +26 -65
- package/dist/src/modeller/component-toolbar/component-toolbar.js.map +1 -1
- package/dist/src/ox-board-list.d.ts +2 -0
- package/dist/src/ox-board-list.js +427 -0
- package/dist/src/ox-board-list.js.map +1 -0
- package/dist/src/ox-board-modeller.d.ts +6 -1
- package/dist/src/ox-board-modeller.js +35 -3
- package/dist/src/ox-board-modeller.js.map +1 -1
- package/dist/src/types.d.ts +30 -0
- package/dist/src/types.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -6
- package/src/component/3d.ts +29 -0
- package/src/component/chart-and-gauge.ts +28 -0
- package/src/component/container.ts +62 -0
- package/src/component/data-source.ts +30 -0
- package/src/component/etc.ts +87 -0
- package/src/component/form.ts +42 -0
- package/src/component/index.ts +12 -0
- package/src/component/iot.ts +52 -0
- package/src/component/line.ts +132 -0
- package/src/component/register-default-groups.ts +28 -0
- package/src/component/shape.ts +154 -0
- package/src/component/table.ts +28 -0
- package/src/component/text-and-media.ts +124 -0
- package/src/component/warehouse.ts +26 -0
- package/src/graphql/board.ts +144 -0
- package/src/graphql/favorite-board.ts +25 -0
- package/src/graphql/group.ts +138 -0
- package/src/graphql/index.ts +4 -0
- package/src/graphql/play-group.ts +189 -0
- package/src/modeller/component-toolbar/component-detail.ts +7 -7
- package/src/modeller/component-toolbar/component-menu.ts +2 -5
- package/src/modeller/component-toolbar/component-toolbar.ts +35 -67
- package/src/ox-board-list.ts +459 -0
- package/src/ox-board-modeller.ts +44 -5
- package/src/types.ts +48 -0
- package/yarn-error.log +0 -18355
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { client } from '@operato/graphql';
|
|
2
|
+
import gql from 'graphql-tag';
|
|
3
|
+
export async function fetchGroup(id) {
|
|
4
|
+
const response = await client.query({
|
|
5
|
+
query: gql `
|
|
6
|
+
query FetchGroupById($id: String!) {
|
|
7
|
+
group(id: $id) {
|
|
8
|
+
id
|
|
9
|
+
name
|
|
10
|
+
description
|
|
11
|
+
createdAt
|
|
12
|
+
creator {
|
|
13
|
+
id
|
|
14
|
+
name
|
|
15
|
+
}
|
|
16
|
+
updatedAt
|
|
17
|
+
updater {
|
|
18
|
+
id
|
|
19
|
+
name
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`,
|
|
24
|
+
variables: { id }
|
|
25
|
+
});
|
|
26
|
+
return response.data;
|
|
27
|
+
}
|
|
28
|
+
export async function updateGroup(group) {
|
|
29
|
+
var { id, name, description } = group;
|
|
30
|
+
const response = await client.mutate({
|
|
31
|
+
mutation: gql `
|
|
32
|
+
mutation UpdateGroup($id: String!, $patch: GroupPatch!) {
|
|
33
|
+
updateGroup(id: $id, patch: $patch) {
|
|
34
|
+
id
|
|
35
|
+
name
|
|
36
|
+
description
|
|
37
|
+
createdAt
|
|
38
|
+
updatedAt
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`,
|
|
42
|
+
variables: {
|
|
43
|
+
id,
|
|
44
|
+
patch: { name, description }
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return response.data;
|
|
48
|
+
}
|
|
49
|
+
export async function deleteGroup(id) {
|
|
50
|
+
const response = await client.mutate({
|
|
51
|
+
mutation: gql `
|
|
52
|
+
mutation ($id: String!) {
|
|
53
|
+
deleteGroup(id: $id)
|
|
54
|
+
}
|
|
55
|
+
`,
|
|
56
|
+
variables: {
|
|
57
|
+
id
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return response.data;
|
|
61
|
+
}
|
|
62
|
+
export async function fetchGroupList() {
|
|
63
|
+
const response = await client.query({
|
|
64
|
+
query: gql `
|
|
65
|
+
{
|
|
66
|
+
groups {
|
|
67
|
+
items {
|
|
68
|
+
id
|
|
69
|
+
name
|
|
70
|
+
description
|
|
71
|
+
createdAt
|
|
72
|
+
updatedAt
|
|
73
|
+
}
|
|
74
|
+
total
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
`
|
|
78
|
+
});
|
|
79
|
+
return response.data;
|
|
80
|
+
}
|
|
81
|
+
export async function createGroup(group) {
|
|
82
|
+
const response = await client.mutate({
|
|
83
|
+
mutation: gql `
|
|
84
|
+
mutation CreateGroup($group: NewGroup!) {
|
|
85
|
+
createGroup(group: $group) {
|
|
86
|
+
id
|
|
87
|
+
name
|
|
88
|
+
description
|
|
89
|
+
createdAt
|
|
90
|
+
updatedAt
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
`,
|
|
94
|
+
variables: { group }
|
|
95
|
+
});
|
|
96
|
+
return response.data;
|
|
97
|
+
}
|
|
98
|
+
export async function joinGroup(boardId, groupId) {
|
|
99
|
+
const response = await client.mutate({
|
|
100
|
+
mutation: gql `
|
|
101
|
+
mutation JoinGroup($id: String!, $boardIds: [String!]!) {
|
|
102
|
+
joinGroup(id: $id, boardIds: $boardIds) {
|
|
103
|
+
id
|
|
104
|
+
name
|
|
105
|
+
description
|
|
106
|
+
boards {
|
|
107
|
+
id
|
|
108
|
+
name
|
|
109
|
+
description
|
|
110
|
+
createdAt
|
|
111
|
+
updatedAt
|
|
112
|
+
}
|
|
113
|
+
createdAt
|
|
114
|
+
updatedAt
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
`,
|
|
118
|
+
variables: {
|
|
119
|
+
id: groupId,
|
|
120
|
+
boardIds: [boardId]
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
return response.data;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.js","sourceRoot":"","sources":["../../../src/graphql/group.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,MAAM,CAAC,KAAK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E,EAAE,KAAK,EAAE;KACrB,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAe,EAAE,OAAe;IAC9D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;KAiBZ;QACD,SAAS,EAAE;YACT,EAAE,EAAE,OAAO;YACX,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC","sourcesContent":["import { BoardGroup } from '../types'\nimport { client } from '@operato/graphql'\nimport gql from 'graphql-tag'\n\nexport async function fetchGroup(id: string) {\n const response = await client.query({\n query: gql`\n query FetchGroupById($id: String!) {\n group(id: $id) {\n id\n name\n description\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n }\n `,\n variables: { id }\n })\n\n return response.data\n}\n\nexport async function updateGroup(group: BoardGroup) {\n var { id, name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateGroup($id: String!, $patch: GroupPatch!) {\n updateGroup(id: $id, patch: $patch) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n patch: { name, description }\n }\n })\n\n return response.data\n}\n\nexport async function deleteGroup(id: string) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n deleteGroup(id: $id)\n }\n `,\n variables: {\n id\n }\n })\n\n return response.data\n}\n\nexport async function fetchGroupList() {\n const response = await client.query({\n query: gql`\n {\n groups {\n items {\n id\n name\n description\n createdAt\n updatedAt\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n\nexport async function createGroup(group: BoardGroup) {\n const response = await client.mutate({\n mutation: gql`\n mutation CreateGroup($group: NewGroup!) {\n createGroup(group: $group) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: { group }\n })\n\n return response.data\n}\n\nexport async function joinGroup(boardId: string, groupId: string) {\n const response = await client.mutate({\n mutation: gql`\n mutation JoinGroup($id: String!, $boardIds: [String!]!) {\n joinGroup(id: $id, boardIds: $boardIds) {\n id\n name\n description\n boards {\n id\n name\n description\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id: groupId,\n boardIds: [boardId]\n }\n })\n\n return response.data\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/graphql/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA","sourcesContent":["export * from './board'\nexport * from './group'\nexport * from './play-group'\nexport * from './favorite-board'\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PlayGroup } from '../types';
|
|
2
|
+
export declare function fetchPlayGroupList(): Promise<any>;
|
|
3
|
+
export declare function fetchPlayGroup(groupId: string): Promise<any>;
|
|
4
|
+
export declare function createPlayGroup(group: PlayGroup): Promise<any>;
|
|
5
|
+
export declare function updatePlayGroup(group: PlayGroup): Promise<any>;
|
|
6
|
+
export declare function deletePlayGroup(id: string): Promise<any>;
|
|
7
|
+
export declare function joinPlayGroup(boardId: string, group: PlayGroup): Promise<any>;
|
|
8
|
+
export declare function leavePlayGroup(boardId: string, groupId: string): Promise<any>;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { client } from '@operato/graphql';
|
|
2
|
+
import gql from 'graphql-tag';
|
|
3
|
+
export async function fetchPlayGroupList() {
|
|
4
|
+
const response = await client.query({
|
|
5
|
+
query: gql `
|
|
6
|
+
{
|
|
7
|
+
playGroups {
|
|
8
|
+
items {
|
|
9
|
+
id
|
|
10
|
+
name
|
|
11
|
+
description
|
|
12
|
+
}
|
|
13
|
+
total
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
`
|
|
17
|
+
});
|
|
18
|
+
return response.data;
|
|
19
|
+
}
|
|
20
|
+
export async function fetchPlayGroup(groupId) {
|
|
21
|
+
const response = await client.query({
|
|
22
|
+
query: gql `
|
|
23
|
+
query FetchPlayGroup($id: String!) {
|
|
24
|
+
playGroup(id: $id) {
|
|
25
|
+
id
|
|
26
|
+
name
|
|
27
|
+
description
|
|
28
|
+
boards {
|
|
29
|
+
id
|
|
30
|
+
name
|
|
31
|
+
description
|
|
32
|
+
model
|
|
33
|
+
thumbnail
|
|
34
|
+
createdAt
|
|
35
|
+
creator {
|
|
36
|
+
id
|
|
37
|
+
name
|
|
38
|
+
}
|
|
39
|
+
updatedAt
|
|
40
|
+
updater {
|
|
41
|
+
id
|
|
42
|
+
name
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
createdAt
|
|
46
|
+
creator {
|
|
47
|
+
id
|
|
48
|
+
name
|
|
49
|
+
}
|
|
50
|
+
updatedAt
|
|
51
|
+
updater {
|
|
52
|
+
id
|
|
53
|
+
name
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`,
|
|
58
|
+
variables: {
|
|
59
|
+
id: groupId
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
return response.data;
|
|
63
|
+
}
|
|
64
|
+
export async function createPlayGroup(group) {
|
|
65
|
+
var { name, description } = group;
|
|
66
|
+
const response = await client.mutate({
|
|
67
|
+
mutation: gql `
|
|
68
|
+
mutation CreatePlayGroup($playGroup: NewPlayGroup!) {
|
|
69
|
+
createPlayGroup(playGroup: $playGroup) {
|
|
70
|
+
id
|
|
71
|
+
name
|
|
72
|
+
description
|
|
73
|
+
createdAt
|
|
74
|
+
updatedAt
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
`,
|
|
78
|
+
variables: {
|
|
79
|
+
playGroup: { name, description }
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return response.data;
|
|
83
|
+
}
|
|
84
|
+
export async function updatePlayGroup(group) {
|
|
85
|
+
var { id, name, description } = group;
|
|
86
|
+
const response = await client.mutate({
|
|
87
|
+
mutation: gql `
|
|
88
|
+
mutation UpdatePlayGroup($id: String!, $patch: PlayGroupPatch!) {
|
|
89
|
+
updatePlayGroup(id: $id, patch: $patch) {
|
|
90
|
+
id
|
|
91
|
+
name
|
|
92
|
+
description
|
|
93
|
+
createdAt
|
|
94
|
+
updatedAt
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
`,
|
|
98
|
+
variables: {
|
|
99
|
+
id,
|
|
100
|
+
patch: { name, description }
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
return response.data;
|
|
104
|
+
}
|
|
105
|
+
export async function deletePlayGroup(id) {
|
|
106
|
+
const response = await client.mutate({
|
|
107
|
+
mutation: gql `
|
|
108
|
+
mutation ($id: String!) {
|
|
109
|
+
deletePlayGroup(id: $id)
|
|
110
|
+
}
|
|
111
|
+
`,
|
|
112
|
+
variables: {
|
|
113
|
+
id
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
return response.data;
|
|
117
|
+
}
|
|
118
|
+
export async function joinPlayGroup(boardId, group) {
|
|
119
|
+
var { id, name, description } = group;
|
|
120
|
+
const response = await client.mutate({
|
|
121
|
+
mutation: gql `
|
|
122
|
+
mutation JoinPlayGroup($id: String!, $boardIds: [String!]!) {
|
|
123
|
+
joinPlayGroup(id: $id, boardIds: $boardIds) {
|
|
124
|
+
id
|
|
125
|
+
name
|
|
126
|
+
description
|
|
127
|
+
boards {
|
|
128
|
+
id
|
|
129
|
+
name
|
|
130
|
+
description
|
|
131
|
+
createdAt
|
|
132
|
+
updatedAt
|
|
133
|
+
}
|
|
134
|
+
createdAt
|
|
135
|
+
updatedAt
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
`,
|
|
139
|
+
variables: {
|
|
140
|
+
id,
|
|
141
|
+
boardIds: [boardId]
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
return response.data;
|
|
145
|
+
}
|
|
146
|
+
export async function leavePlayGroup(boardId, groupId) {
|
|
147
|
+
const response = await client.mutate({
|
|
148
|
+
mutation: gql `
|
|
149
|
+
mutation ($id: String!, $boardIds: [String]!) {
|
|
150
|
+
leavePlayGroup(id: $id, boardIds: $boardIds) {
|
|
151
|
+
id
|
|
152
|
+
name
|
|
153
|
+
description
|
|
154
|
+
boards {
|
|
155
|
+
id
|
|
156
|
+
name
|
|
157
|
+
description
|
|
158
|
+
createdAt
|
|
159
|
+
updatedAt
|
|
160
|
+
}
|
|
161
|
+
createdAt
|
|
162
|
+
updatedAt
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
`,
|
|
166
|
+
variables: {
|
|
167
|
+
id: groupId,
|
|
168
|
+
boardIds: [boardId]
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
return response.data;
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=play-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"play-group.js","sourceRoot":"","sources":["../../../src/graphql/play-group.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;KAWT;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAe;IAClD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmCT;QACD,SAAS,EAAE;YACT,EAAE,EAAE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;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;KAiBZ;QACD,SAAS,EAAE;YACT,EAAE;YACF,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAe,EAAE,OAAe;IACnE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;KAiBZ;QACD,SAAS,EAAE;YACT,EAAE,EAAE,OAAO;YACX,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC","sourcesContent":["import { PlayGroup } from '../types'\nimport { client } from '@operato/graphql'\nimport gql from 'graphql-tag'\n\nexport async function fetchPlayGroupList() {\n const response = await client.query({\n query: gql`\n {\n playGroups {\n items {\n id\n name\n description\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n\nexport async function fetchPlayGroup(groupId: string) {\n const response = await client.query({\n query: gql`\n query FetchPlayGroup($id: String!) {\n playGroup(id: $id) {\n id\n name\n description\n boards {\n id\n name\n description\n model\n thumbnail\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n }\n `,\n variables: {\n id: groupId\n }\n })\n\n return response.data\n}\n\nexport async function createPlayGroup(group: PlayGroup) {\n var { name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreatePlayGroup($playGroup: NewPlayGroup!) {\n createPlayGroup(playGroup: $playGroup) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n playGroup: { name, description }\n }\n })\n\n return response.data\n}\n\nexport async function updatePlayGroup(group: PlayGroup) {\n var { id, name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdatePlayGroup($id: String!, $patch: PlayGroupPatch!) {\n updatePlayGroup(id: $id, patch: $patch) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n patch: { name, description }\n }\n })\n\n return response.data\n}\n\nexport async function deletePlayGroup(id: string) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n deletePlayGroup(id: $id)\n }\n `,\n variables: {\n id\n }\n })\n return response.data\n}\n\nexport async function joinPlayGroup(boardId: string, group: PlayGroup) {\n var { id, name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation JoinPlayGroup($id: String!, $boardIds: [String!]!) {\n joinPlayGroup(id: $id, boardIds: $boardIds) {\n id\n name\n description\n boards {\n id\n name\n description\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n boardIds: [boardId]\n }\n })\n\n return response.data\n}\n\nexport async function leavePlayGroup(boardId: string, groupId: string) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $boardIds: [String]!) {\n leavePlayGroup(id: $id, boardIds: $boardIds) {\n id\n name\n description\n boards {\n id\n name\n description\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id: groupId,\n boardIds: [boardId]\n }\n })\n\n return response.data\n}\n"]}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import { __decorate } from "tslib";
|
|
5
|
-
import
|
|
5
|
+
import '@operato/markdown';
|
|
6
|
+
import { LitElement, css, html } from 'lit';
|
|
6
7
|
import { customElement, property } from 'lit/decorators.js';
|
|
7
8
|
import { ScrollbarStyles } from '@operato/styles';
|
|
8
9
|
let ComponentDetail = class ComponentDetail extends LitElement {
|
|
@@ -11,10 +12,9 @@ let ComponentDetail = class ComponentDetail extends LitElement {
|
|
|
11
12
|
this.template = null;
|
|
12
13
|
}
|
|
13
14
|
render() {
|
|
14
|
-
const { about
|
|
15
|
-
return
|
|
15
|
+
const { about } = this.template || {};
|
|
16
|
+
return html ` <ox-markdown .src=${about}></ox-markdown> `;
|
|
16
17
|
}
|
|
17
|
-
updated(changes) { }
|
|
18
18
|
};
|
|
19
19
|
ComponentDetail.styles = [
|
|
20
20
|
ScrollbarStyles,
|
|
@@ -26,7 +26,7 @@ ComponentDetail.styles = [
|
|
|
26
26
|
|
|
27
27
|
background-color: var(--component-detail-background-color, white);
|
|
28
28
|
margin: 0px;
|
|
29
|
-
padding:
|
|
29
|
+
padding: 10px;
|
|
30
30
|
|
|
31
31
|
width: 360px;
|
|
32
32
|
height: 100%;
|
|
@@ -42,7 +42,7 @@ ComponentDetail.styles = [
|
|
|
42
42
|
z-index: 1;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
ox-markdown {
|
|
46
46
|
flex: 1;
|
|
47
47
|
}
|
|
48
48
|
`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-detail.js","sourceRoot":"","sources":["../../../../src/modeller/component-toolbar/component-detail.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"component-detail.js","sourceRoot":"","sources":["../../../../src/modeller/component-toolbar/component-detail.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,mBAAmB,CAAA;AAE1B,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGjD,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QAiC8B,aAAQ,GAA6B,IAAI,CAAA;IAOvE,CAAC;IALC,MAAM;QACJ,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAA;QAErC,OAAO,IAAI,CAAA,sBAAsB,KAAK,kBAAkB,CAAA;IAC1D,CAAC;CACF,CAAA;AAvCQ,sBAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BF;CACF,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAA0C;AAjCjE,eAAe;IADpB,aAAa,CAAC,kBAAkB,CAAC;GAC5B,eAAe,CAwCpB","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@operato/markdown'\n\nimport { LitElement, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { ScrollbarStyles } from '@operato/styles'\n\n@customElement('component-detail')\nclass ComponentDetail extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n align-content: stretch;\n\n background-color: var(--component-detail-background-color, white);\n margin: 0px;\n padding: 10px;\n\n width: 360px;\n height: 100%;\n\n overflow: hidden;\n\n border: 2px solid var(--component-detail-border-color);\n box-sizing: border-box;\n\n position: absolute;\n top: 0px;\n\n z-index: 1;\n }\n\n ox-markdown {\n flex: 1;\n }\n `\n ]\n\n @property({ type: Object }) template: { about: string } | null = null\n\n render() {\n const { about } = this.template || {}\n\n return html` <ox-markdown .src=${about}></ox-markdown> `\n }\n}\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __decorate } from "tslib";
|
|
5
5
|
import './component-detail';
|
|
6
|
-
import { css, html
|
|
6
|
+
import { LitElement, css, html } from 'lit';
|
|
7
7
|
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
8
8
|
import { ScrollbarStyles } from '@operato/styles';
|
|
9
9
|
import noImage from '../../../../assets/images/components/no-image.png';
|
|
@@ -77,7 +77,6 @@ let ComponentMenu = class ComponentMenu extends LitElement {
|
|
|
77
77
|
if (!type) {
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
// var group = this.groups.find(g => g.name == this.group)
|
|
81
80
|
if (this.scene) {
|
|
82
81
|
this.template = this.templates.find(template => template.type == type);
|
|
83
82
|
this.template && this.scene.add(JSON.parse(JSON.stringify(this.template.model)), { cx: 200, cy: 200 });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-menu.js","sourceRoot":"","sources":["../../../../src/modeller/component-toolbar/component-menu.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"component-menu.js","sourceRoot":"","sources":["../../../../src/modeller/component-toolbar/component-menu.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,UAAU,EAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGzE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,OAAO,MAAM,mDAAmD,CAAA;AAGvE,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QAoF8B,WAAM,GAAa,EAAE,CAAA;QACrB,UAAK,GAAiB,IAAI,CAAA;QAC1B,UAAK,GAAkB,EAAE,CAAA;QAE5C,cAAS,GAAiB,EAAE,CAAA;IAmFvC,CAAC;IA9EC,MAAM;QACJ,OAAO,IAAI,CAAC,KAAK;YACf,CAAC,CAAC,IAAI,CAAA;wBACY,CAAC,CAAa,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,IAAI,IAAI,CAAC,KAAK;;;;yBAInD,CAAC,CAAa,EAAE,EAAE,CAA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C,CAAC;CACF,CAAA;AA1KQ,oBAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8EF;CACF,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAsB;AACrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAA2B;AAC1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAA0B;AAE5C;IAAR,KAAK,EAAE;gDAA6B;AAC5B;IAAR,KAAK,EAAE;+CAA2B;AAER;IAA1B,KAAK,CAAC,kBAAkB,CAAC;6CAAqB;AA3F3C,aAAa;IADlB,aAAa,CAAC,gBAAgB,CAAC;GAC1B,aAAa,CA2KlB","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport './component-detail'\n\nimport { LitElement, PropertyValues, css, html } from 'lit'\nimport { Pallet, PalletItem } from '../../types'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { Scene } from '@hatiolab/things-scene'\nimport { ScrollbarStyles } from '@operato/styles'\nimport noImage from '../../../../assets/images/components/no-image.png'\n\n@customElement('component-menu')\nclass ComponentMenu extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n align-content: stretch;\n\n background-color: var(--component-menu-background-color);\n margin: 0px;\n padding: 0px;\n\n width: 180px;\n height: 100%;\n\n overflow: visible;\n\n border: 2px solid var(--component-menu-border-color);\n box-sizing: border-box;\n\n position: absolute;\n top: 0px;\n\n z-index: 1;\n }\n\n h2 {\n background-color: var(--component-menu-border-color);\n padding: 1px 5px;\n margin: 0;\n font: var(--component-menu-title);\n color: #fff;\n text-transform: capitalize;\n }\n\n [templates] {\n flex: 1;\n\n display: block;\n margin: 0;\n padding: 0;\n overflow-y: auto;\n\n background-color: var(--component-menu-background-color);\n }\n\n [template] {\n display: flex;\n align-items: center;\n min-height: var(--component-menu-item-icon-size);\n padding: 0 5px 0 0;\n border-bottom: 1px solid rgba(0, 0, 0, 0.1);\n font-size: 11px;\n color: var(--component-menu-item-color);\n }\n\n [template]:hover,\n [template]:focus {\n color: var(--component-menu-item-hover-color);\n font-weight: bold;\n cursor: pointer;\n }\n\n [template] img {\n margin: 5px;\n width: var(--component-menu-item-icon-size);\n height: var(--component-menu-item-icon-size);\n }\n\n component-detail {\n position: absolute;\n top: 0;\n left: 180px;\n height: 100%;\n outline: none;\n }\n\n component-detail[hidden] {\n display: none;\n }\n `\n ]\n\n @property({ type: Object }) groups: Pallet[] = []\n @property({ type: Object }) scene: Scene | null = null\n @property({ type: String }) group: string | null = ''\n\n @state() templates: PalletItem[] = []\n @state() template: PalletItem | any\n\n @query('component-detail') detail!: HTMLElement\n\n render() {\n return this.group\n ? html`\n <h2 onclick=${(e: MouseEvent) => e.stopPropagation()}>${this.group} list</h2>\n\n <div\n templates\n @mouseover=${(e: MouseEvent) => this.onHoverComponent(e)}\n @mouseout=${(e: MouseEvent) => (this.template = null)}\n >\n ${(this.templates || []).map(\n template => html`\n <div @click=${this.onClickTemplate} data-type=${template.type} template>\n <img src=${this.templateIcon(template)} />${template.type}\n </div>\n `\n )}\n </div>\n\n <component-detail\n tabindex=\"-1\"\n @focusout=${() => {\n this.template = null\n }}\n .template=${this.template}\n hidden\n >\n </component-detail>\n `\n : html``\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('group')) {\n if (!this.group) {\n this.templates = []\n this.setAttribute('hidden', '')\n } else {\n this.templates = this.groups.find((g: Pallet) => g.name === this.group)?.templates || []\n this.removeAttribute('active')\n }\n }\n\n if (changes.has('template')) {\n this.template && this.template.about\n ? this.detail.removeAttribute('hidden')\n : this.detail.setAttribute('hidden', '')\n }\n }\n\n findTemplate(type: string | null | undefined) {\n this.template = type && this.templates.find(template => template.type == type)\n }\n\n onHoverComponent(e: MouseEvent) {\n const button = e.target as HTMLElement\n this.findTemplate(button!.closest('[data-type]')?.getAttribute('data-type'))\n }\n\n onClickTemplate(e: MouseEvent) {\n var item = e.target as HTMLElement\n var type = item.closest('[data-type]')?.getAttribute('data-type')\n\n if (!type) {\n return\n }\n\n if (this.scene) {\n this.template = this.templates.find(template => template.type == type)\n this.template && this.scene.add(JSON.parse(JSON.stringify(this.template.model)), { cx: 200, cy: 200 })\n }\n\n this.group = null\n }\n\n templateIcon(template: PalletItem) {\n return template.icon || noImage\n }\n}\n"]}
|
|
@@ -3,16 +3,27 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __decorate } from "tslib";
|
|
5
5
|
import './component-menu';
|
|
6
|
-
import { css, html
|
|
7
|
-
import { customElement, property, query, queryAll } from 'lit/decorators.js';
|
|
6
|
+
import { LitElement, css, html } from 'lit';
|
|
8
7
|
import { SCENE_MODE } from '@hatiolab/things-scene';
|
|
8
|
+
import { customElement, property, query, queryAll } from 'lit/decorators.js';
|
|
9
9
|
let ComponentToolbar = class ComponentToolbar extends LitElement {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments);
|
|
12
12
|
this.componentGroupList = [];
|
|
13
13
|
this.mode = SCENE_MODE.VIEW;
|
|
14
|
+
this.icons = {};
|
|
14
15
|
}
|
|
15
16
|
updated(changes) {
|
|
17
|
+
if (changes.has('componentGroupList')) {
|
|
18
|
+
const color = getComputedStyle(this, null).getPropertyValue('--primary-color');
|
|
19
|
+
this.icons = (this.componentGroupList || [])
|
|
20
|
+
.filter(group => { var _a; return ((_a = group.templates) === null || _a === void 0 ? void 0 : _a.length) > 0; })
|
|
21
|
+
.reduce((sum, group) => {
|
|
22
|
+
sum[group.name] =
|
|
23
|
+
'data:image/svg+xml;charset=UTF-8;base64,' + btoa(group.icon.replace(/{{strokeColor}}/g, color));
|
|
24
|
+
return sum;
|
|
25
|
+
}, {});
|
|
26
|
+
}
|
|
16
27
|
if (changes.has('group')) {
|
|
17
28
|
this.groups.forEach(group => {
|
|
18
29
|
group.getAttribute('data-group') === this.group
|
|
@@ -23,10 +34,17 @@ let ComponentToolbar = class ComponentToolbar extends LitElement {
|
|
|
23
34
|
}
|
|
24
35
|
}
|
|
25
36
|
render() {
|
|
37
|
+
const componentList = this.componentGroupList || [];
|
|
26
38
|
return html `
|
|
27
|
-
${
|
|
39
|
+
${componentList
|
|
28
40
|
.filter(group => { var _a; return ((_a = group.templates) === null || _a === void 0 ? void 0 : _a.length) > 0; })
|
|
29
|
-
.map(
|
|
41
|
+
.map(group => html `
|
|
42
|
+
<img
|
|
43
|
+
data-group=${group.name}
|
|
44
|
+
@click=${(e) => this._onClickGroup(e)}
|
|
45
|
+
.src=${this.icons[group.name]}
|
|
46
|
+
/>
|
|
47
|
+
`)}
|
|
30
48
|
|
|
31
49
|
<component-menu
|
|
32
50
|
tabindex="-1"
|
|
@@ -35,7 +53,7 @@ let ComponentToolbar = class ComponentToolbar extends LitElement {
|
|
|
35
53
|
}}
|
|
36
54
|
.scene=${this.scene}
|
|
37
55
|
.group=${this.group}
|
|
38
|
-
.groups=${
|
|
56
|
+
.groups=${componentList}
|
|
39
57
|
hidden
|
|
40
58
|
>
|
|
41
59
|
</component-menu>
|
|
@@ -62,7 +80,7 @@ ComponentToolbar.styles = [
|
|
|
62
80
|
background-color: var(--component-toolbar-background-color);
|
|
63
81
|
}
|
|
64
82
|
|
|
65
|
-
|
|
83
|
+
img {
|
|
66
84
|
display: flex;
|
|
67
85
|
flex-direction: row;
|
|
68
86
|
|
|
@@ -72,65 +90,8 @@ ComponentToolbar.styles = [
|
|
|
72
90
|
|
|
73
91
|
border-bottom: var(--component-toolbar-border);
|
|
74
92
|
margin: 0;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
span[data-group='line'] {
|
|
79
|
-
background-position: 50% -186px;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
span[data-group='shape'] {
|
|
83
|
-
background-position: 0px -284px;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
span[data-group='textAndMedia'] {
|
|
87
|
-
background-position: 50% -385px;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
span[data-group='chartAndGauge'] {
|
|
91
|
-
background-position: 50% -488px;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
span[data-group='table'] {
|
|
95
|
-
background-position: 50% -585px;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
span[data-group='container'] {
|
|
99
|
-
background-position: 50% -685px;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
span[data-group='dataSource'] {
|
|
103
|
-
background-position: 50% -888px;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
span[data-group='IoT'] {
|
|
107
|
-
background-position: -3px -788px;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
span[data-group='3D'] {
|
|
111
|
-
background-position: 50% -992px;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
span[data-group='warehouse'] {
|
|
115
|
-
background-position: -2px -1089px;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
span[data-group='form'] {
|
|
119
|
-
background-position: -2px -1287px;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
span[data-group='etc'] {
|
|
123
|
-
background-position: -1px -1189px;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.pressed {
|
|
127
|
-
background-position: 0 15px;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.pressed[pressed],
|
|
131
|
-
.pressed[active] {
|
|
132
|
-
background-position: -3px -88px;
|
|
133
|
-
background-color: #beb9b3;
|
|
93
|
+
padding: 6px;
|
|
94
|
+
box-sizing: border-box;
|
|
134
95
|
}
|
|
135
96
|
|
|
136
97
|
component-menu {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-toolbar.js","sourceRoot":"","sources":["../../../../src/modeller/component-toolbar/component-toolbar.ts"],"names":[],"mappings":"A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,aAAa,CAAC,CAAa;;QAC/B,IAAI,MAAM,GAAG,CAAC,CAAC,MAAqB,CAAA;QAEpC,IAAI,CAAC,KAAK,GAAG,MAAA,MAAO,CAAC,OAAO,CAAC,cAAc,CAAC,0CAAE,YAAY,CAAC,YAAY,CAAC,CAAA;QAExE,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAM;QAEvB,MAAM,IAAI,CAAC,cAAc,CAAA;QAEzB,MAAA,IAAI,CAAC,IAAI,0CAAE,KAAK,EAAE,CAAA;IACpB,CAAC;CACF,CAAA;AAlHQ,uBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmCF;CACF,CAAA;AAE0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;4DAA0C;AACxC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAsB;AACrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAc;AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAmC;AAErC;IAAxB,KAAK,CAAC,gBAAgB,CAAC;8CAA2B;AACzB;IAAzB,QAAQ,CAAC,cAAc,CAAC;gDAAyC;AA9C9D,gBAAgB;IADrB,aAAa,CAAC,mBAAmB,CAAC;GAC7B,gBAAgB,CAmHrB","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport './component-menu'\n\nimport { LitElement, PropertyValues, css, html } from 'lit'\nimport { SCENE_MODE, Scene } from '@hatiolab/things-scene'\nimport { customElement, property, query, queryAll } from 'lit/decorators.js'\n\nimport { ComponentGroup } from '../../types'\n\n@customElement('component-toolbar')\nclass ComponentToolbar extends LitElement {\n static styles = [\n css`\n :host {\n left: 0;\n display: block;\n position: relative;\n\n width: var(--component-toolbar-icon-size);\n background-color: var(--component-toolbar-background-color);\n }\n\n img {\n display: flex;\n flex-direction: row;\n\n width: var(--component-toolbar-icon-size);\n height: var(--component-toolbar-icon-size);\n min-width: 50%;\n\n border-bottom: var(--component-toolbar-border);\n margin: 0;\n padding: 6px;\n box-sizing: border-box;\n }\n\n component-menu {\n position: absolute;\n top: 0;\n left: var(--component-toolbar-icon-size);\n height: 100%;\n outline: none;\n }\n\n component-menu[hidden] {\n display: none;\n }\n `\n ]\n\n @property({ type: Array }) componentGroupList: ComponentGroup[] = []\n @property({ type: String }) group?: string | null\n @property({ type: Object }) scene!: Scene\n @property({ type: Number }) mode: SCENE_MODE = SCENE_MODE.VIEW\n\n @query('component-menu') private menu!: HTMLElement\n @queryAll('[data-group]') private groups!: NodeListOf<HTMLElement>\n\n private icons: { [name: string]: string } = {}\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('componentGroupList')) {\n const color = getComputedStyle(this, null).getPropertyValue('--primary-color')\n\n this.icons = (this.componentGroupList || [])\n .filter(group => group.templates?.length > 0)\n .reduce((sum, group: ComponentGroup) => {\n sum[group.name] =\n 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(group.icon.replace(/{{strokeColor}}/g, color))\n return sum\n }, {} as { [name: string]: string })\n }\n\n if (changes.has('group')) {\n this.groups.forEach(group => {\n group.getAttribute('data-group') === this.group\n ? group.setAttribute('active', '')\n : group.removeAttribute('active')\n })\n\n this.group ? this.menu.removeAttribute('hidden') : this.menu.setAttribute('hidden', '')\n }\n }\n\n render() {\n const componentList = this.componentGroupList || []\n\n return html`\n ${componentList\n .filter(group => group.templates?.length > 0)\n .map(\n group => html`\n <img\n data-group=${group.name}\n @click=${(e: MouseEvent) => this._onClickGroup(e)}\n .src=${this.icons[group.name]}\n />\n `\n )}\n\n <component-menu\n tabindex=\"-1\"\n @focusout=${() => {\n this.group = null\n }}\n .scene=${this.scene}\n .group=${this.group}\n .groups=${componentList}\n hidden\n >\n </component-menu>\n `\n }\n\n async _onClickGroup(e: MouseEvent) {\n var button = e.target as HTMLElement\n\n this.group = button!.closest('[data-group]')?.getAttribute('data-group')\n\n if (!this.group) return\n\n await this.updateComplete\n\n this.menu?.focus()\n }\n}\n"]}
|