@things-factory/board-ui 6.2.102 → 6.2.103
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-client/apptools/favorite-tool.d.ts +26 -0
- package/dist-client/apptools/favorite-tool.js +129 -0
- package/dist-client/apptools/favorite-tool.js.map +1 -0
- package/dist-client/board-list/board-importer.d.ts +6 -0
- package/dist-client/board-list/board-importer.js +112 -0
- package/dist-client/board-list/board-importer.js.map +1 -0
- package/dist-client/board-list/board-tile-list.d.ts +22 -0
- package/dist-client/board-list/board-tile-list.js +264 -0
- package/dist-client/board-list/board-tile-list.js.map +1 -0
- package/dist-client/board-list/group-bar.d.ts +14 -0
- package/dist-client/board-list/group-bar.js +145 -0
- package/dist-client/board-list/group-bar.js.map +1 -0
- package/dist-client/board-list/play-group-bar.d.ts +21 -0
- package/dist-client/board-list/play-group-bar.js +142 -0
- package/dist-client/board-list/play-group-bar.js.map +1 -0
- package/dist-client/board-provider.d.ts +3 -0
- package/dist-client/board-provider.js +77 -0
- package/dist-client/board-provider.js.map +1 -0
- package/dist-client/bootstrap.d.ts +2 -0
- package/dist-client/bootstrap.js +30 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/data-grist/board-editor.d.ts +14 -0
- package/dist-client/data-grist/board-editor.js +110 -0
- package/dist-client/data-grist/board-editor.js.map +1 -0
- package/dist-client/data-grist/board-renderer.d.ts +2 -0
- package/dist-client/data-grist/board-renderer.js +134 -0
- package/dist-client/data-grist/board-renderer.js.map +1 -0
- package/dist-client/data-grist/color-map-editor.d.ts +4 -0
- package/dist-client/data-grist/color-map-editor.js +15 -0
- package/dist-client/data-grist/color-map-editor.js.map +1 -0
- package/dist-client/data-grist/color-ranges-editor.d.ts +4 -0
- package/dist-client/data-grist/color-ranges-editor.js +15 -0
- package/dist-client/data-grist/color-ranges-editor.js.map +1 -0
- package/dist-client/graphql/board-template.d.ts +5 -0
- package/dist-client/graphql/board-template.js +128 -0
- package/dist-client/graphql/board-template.js.map +1 -0
- package/dist-client/graphql/board.d.ts +19 -0
- package/dist-client/graphql/board.js +231 -0
- package/dist-client/graphql/board.js.map +1 -0
- package/dist-client/graphql/favorite-board.d.ts +1 -0
- package/dist-client/graphql/favorite-board.js +24 -0
- package/dist-client/graphql/favorite-board.js.map +1 -0
- package/dist-client/graphql/group.d.ts +6 -0
- package/dist-client/graphql/group.js +125 -0
- package/dist-client/graphql/group.js.map +1 -0
- package/dist-client/graphql/index.d.ts +6 -0
- package/dist-client/graphql/index.js +7 -0
- package/dist-client/graphql/index.js.map +1 -0
- package/dist-client/graphql/my-board.d.ts +1 -0
- package/dist-client/graphql/my-board.js +24 -0
- package/dist-client/graphql/my-board.js.map +1 -0
- package/dist-client/graphql/play-group.d.ts +7 -0
- package/dist-client/graphql/play-group.js +173 -0
- package/dist-client/graphql/play-group.js.map +1 -0
- package/dist-client/index.d.ts +8 -0
- package/dist-client/index.js +9 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/attachment-list-page.d.ts +30 -0
- package/dist-client/pages/attachment-list-page.js +128 -0
- package/dist-client/pages/attachment-list-page.js.map +1 -0
- package/dist-client/pages/board-list-page.d.ts +109 -0
- package/dist-client/pages/board-list-page.js +532 -0
- package/dist-client/pages/board-list-page.js.map +1 -0
- package/dist-client/pages/board-modeller-page.d.ts +49 -0
- package/dist-client/pages/board-modeller-page.js +309 -0
- package/dist-client/pages/board-modeller-page.js.map +1 -0
- package/dist-client/pages/board-player-by-name-page.d.ts +4 -0
- package/dist-client/pages/board-player-by-name-page.js +32 -0
- package/dist-client/pages/board-player-by-name-page.js.map +1 -0
- package/dist-client/pages/board-player-page.d.ts +42 -0
- package/dist-client/pages/board-player-page.js +230 -0
- package/dist-client/pages/board-player-page.js.map +1 -0
- package/dist-client/pages/board-template/board-template-list-page.d.ts +37 -0
- package/dist-client/pages/board-template/board-template-list-page.js +226 -0
- package/dist-client/pages/board-template/board-template-list-page.js.map +1 -0
- package/dist-client/pages/board-viewer-by-name-page.d.ts +4 -0
- package/dist-client/pages/board-viewer-by-name-page.js +27 -0
- package/dist-client/pages/board-viewer-by-name-page.js.map +1 -0
- package/dist-client/pages/board-viewer-page.d.ts +41 -0
- package/dist-client/pages/board-viewer-page.js +246 -0
- package/dist-client/pages/board-viewer-page.js.map +1 -0
- package/dist-client/pages/font-list-page.d.ts +9 -0
- package/dist-client/pages/font-list-page.js +31 -0
- package/dist-client/pages/font-list-page.js.map +1 -0
- package/dist-client/pages/play-list-page.d.ts +58 -0
- package/dist-client/pages/play-list-page.js +364 -0
- package/dist-client/pages/play-list-page.js.map +1 -0
- package/dist-client/pages/printable-board-viewer-page.d.ts +11 -0
- package/dist-client/pages/printable-board-viewer-page.js +43 -0
- package/dist-client/pages/printable-board-viewer-page.js.map +1 -0
- package/dist-client/pages/theme/theme-editors.d.ts +5 -0
- package/dist-client/pages/theme/theme-editors.js +53 -0
- package/dist-client/pages/theme/theme-editors.js.map +1 -0
- package/dist-client/pages/theme/theme-list-page.d.ts +49 -0
- package/dist-client/pages/theme/theme-list-page.js +318 -0
- package/dist-client/pages/theme/theme-list-page.js.map +1 -0
- package/dist-client/pages/things-scene-components-with-tools.import +0 -0
- package/dist-client/pages/things-scene-components.import +0 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +41 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/setting-let/board-view-setting-let.d.ts +14 -0
- package/dist-client/setting-let/board-view-setting-let.js +66 -0
- package/dist-client/setting-let/board-view-setting-let.js.map +1 -0
- package/dist-client/themes/board-theme.css +76 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-client/viewparts/board-basic-info.d.ts +47 -0
- package/dist-client/viewparts/board-basic-info.js +641 -0
- package/dist-client/viewparts/board-basic-info.js.map +1 -0
- package/dist-client/viewparts/board-info-link.d.ts +12 -0
- package/dist-client/viewparts/board-info-link.js +59 -0
- package/dist-client/viewparts/board-info-link.js.map +1 -0
- package/dist-client/viewparts/board-info.d.ts +14 -0
- package/dist-client/viewparts/board-info.js +94 -0
- package/dist-client/viewparts/board-info.js.map +1 -0
- package/dist-client/viewparts/board-template-builder.d.ts +16 -0
- package/dist-client/viewparts/board-template-builder.js +145 -0
- package/dist-client/viewparts/board-template-builder.js.map +1 -0
- package/dist-client/viewparts/board-versions.d.ts +12 -0
- package/dist-client/viewparts/board-versions.js +157 -0
- package/dist-client/viewparts/board-versions.js.map +1 -0
- package/dist-client/viewparts/group-info-basic.d.ts +16 -0
- package/dist-client/viewparts/group-info-basic.js +247 -0
- package/dist-client/viewparts/group-info-basic.js.map +1 -0
- package/dist-client/viewparts/group-info-import.d.ts +15 -0
- package/dist-client/viewparts/group-info-import.js +137 -0
- package/dist-client/viewparts/group-info-import.js.map +1 -0
- package/dist-client/viewparts/group-info.d.ts +10 -0
- package/dist-client/viewparts/group-info.js +92 -0
- package/dist-client/viewparts/group-info.js.map +1 -0
- package/dist-client/viewparts/index.d.ts +3 -0
- package/dist-client/viewparts/index.js +4 -0
- package/dist-client/viewparts/index.js.map +1 -0
- package/dist-client/viewparts/link-builder.d.ts +22 -0
- package/dist-client/viewparts/link-builder.js +217 -0
- package/dist-client/viewparts/link-builder.js.map +1 -0
- package/dist-client/viewparts/play-group-info-basic.d.ts +16 -0
- package/dist-client/viewparts/play-group-info-basic.js +249 -0
- package/dist-client/viewparts/play-group-info-basic.js.map +1 -0
- package/dist-client/viewparts/play-group-info-link.d.ts +10 -0
- package/dist-client/viewparts/play-group-info-link.js +48 -0
- package/dist-client/viewparts/play-group-info-link.js.map +1 -0
- package/dist-client/viewparts/play-group-info.d.ts +13 -0
- package/dist-client/viewparts/play-group-info.js +90 -0
- package/dist-client/viewparts/play-group-info.js.map +1 -0
- package/dist-server/index.js +5 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/migrations/index.js +12 -0
- package/dist-server/migrations/index.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import './things-scene-components.import';
|
|
3
|
+
import '@operato/board/ox-board-player.js';
|
|
4
|
+
import gql from 'graphql-tag';
|
|
5
|
+
import { css, html } from 'lit';
|
|
6
|
+
import { customElement, state, query } from 'lit/decorators.js';
|
|
7
|
+
import { connect } from 'pwa-helpers/connect-mixin.js';
|
|
8
|
+
import { createBoardProvider } from '../board-provider';
|
|
9
|
+
import { store, PageView } from '@operato/shell';
|
|
10
|
+
import { clientSettingStore } from '@operato/shell/object-store.js';
|
|
11
|
+
import { client, subscribe } from '@operato/graphql';
|
|
12
|
+
import { BoardPlayer } from '@operato/board/ox-board-player.js';
|
|
13
|
+
function parseQuery(query) {
|
|
14
|
+
for (const key in query) {
|
|
15
|
+
if (query.hasOwnProperty(key)) {
|
|
16
|
+
try {
|
|
17
|
+
query[key] = JSON.parse(query[key]);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
// do nothing
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return query;
|
|
25
|
+
}
|
|
26
|
+
let BoardPlayerPage = class BoardPlayerPage extends connect(store)(PageView) {
|
|
27
|
+
connectedCallback() {
|
|
28
|
+
super.connectedCallback();
|
|
29
|
+
this.provider = createBoardProvider();
|
|
30
|
+
}
|
|
31
|
+
disconnectedCallback() {
|
|
32
|
+
super.disconnectedCallback();
|
|
33
|
+
this.provider.dispose();
|
|
34
|
+
delete this.provider;
|
|
35
|
+
}
|
|
36
|
+
async fetch(id) {
|
|
37
|
+
return await client.query({
|
|
38
|
+
query: gql `
|
|
39
|
+
query ($id: String!) {
|
|
40
|
+
response: playGroup(id: $id) {
|
|
41
|
+
id
|
|
42
|
+
name
|
|
43
|
+
description
|
|
44
|
+
boards {
|
|
45
|
+
id
|
|
46
|
+
model
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
`,
|
|
51
|
+
variables: {
|
|
52
|
+
id
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
async refresh() {
|
|
57
|
+
var _a;
|
|
58
|
+
if (!this.playGroupId) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
this.showSpinner = true;
|
|
63
|
+
this.updateContext();
|
|
64
|
+
const response = await this.fetch(this.playGroupId);
|
|
65
|
+
this.playGroup = response.data.response;
|
|
66
|
+
if (!this.playGroup) {
|
|
67
|
+
throw 'playgroup not found';
|
|
68
|
+
}
|
|
69
|
+
this.boards = this.playGroup.boards;
|
|
70
|
+
}
|
|
71
|
+
catch (ex) {
|
|
72
|
+
document.dispatchEvent(new CustomEvent('notify', {
|
|
73
|
+
detail: {
|
|
74
|
+
level: 'error',
|
|
75
|
+
message: ex,
|
|
76
|
+
ex
|
|
77
|
+
}
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
finally {
|
|
81
|
+
this.showSpinner = false;
|
|
82
|
+
this.updateContext();
|
|
83
|
+
const { autoRefresh = true } = ((_a = (await clientSettingStore.get('board-view'))) === null || _a === void 0 ? void 0 : _a.value) || {};
|
|
84
|
+
autoRefresh && this.startSubscribingForAutoRefresh();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
updated(changes) {
|
|
88
|
+
if (changes.has('playGroupId')) {
|
|
89
|
+
this.boardPlayer.stop();
|
|
90
|
+
this.refresh();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
stateChanged(state) {
|
|
94
|
+
this.baseUrl = state.app.baseUrl;
|
|
95
|
+
}
|
|
96
|
+
get oopsNote() {
|
|
97
|
+
return {
|
|
98
|
+
icon: 'style',
|
|
99
|
+
title: 'EMPTY PLAYGROUP',
|
|
100
|
+
description: 'There are no board to be shown'
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
get context() {
|
|
104
|
+
return {
|
|
105
|
+
title: this.playGroup ? this.playGroup.name : this.showSpinner ? 'Fetching playgroup...' : 'Playgroup Not Found'
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
render() {
|
|
109
|
+
var oops = !this.showSpinner && !this.playGroup && this.oopsNote;
|
|
110
|
+
return oops
|
|
111
|
+
? html ` <oops-note icon=${oops.icon} title=${oops.title} description=${oops.description}></oops-note> `
|
|
112
|
+
: html `
|
|
113
|
+
<ox-board-player .boards=${this.boards} .data=${this.data} .provider=${this.provider}></ox-board-player>
|
|
114
|
+
<oops-spinner ?show=${this.showSpinner}></oops-spinner>
|
|
115
|
+
`;
|
|
116
|
+
}
|
|
117
|
+
pageUpdated(changes, lifecycle) {
|
|
118
|
+
if (this.active) {
|
|
119
|
+
this.playGroupId = lifecycle.resourceId;
|
|
120
|
+
this.data = parseQuery(Object.assign({}, lifecycle.params));
|
|
121
|
+
this.refresh();
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
this.stopSubscribing();
|
|
125
|
+
this.playGroupId = null;
|
|
126
|
+
this.boardPlayer.stop();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async startSubscribingForAutoRefresh() {
|
|
130
|
+
if (!this.playGroup) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
await this.stopSubscribing();
|
|
134
|
+
this.subscriptionForAutoRefresh = await subscribe({
|
|
135
|
+
query: gql `
|
|
136
|
+
subscription ($id: String!) {
|
|
137
|
+
playGroup(id: $id) {
|
|
138
|
+
id
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
`,
|
|
142
|
+
variables: {
|
|
143
|
+
id: this.playGroup.id
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
146
|
+
next: async ({ data }) => {
|
|
147
|
+
await this.stopSubscribing();
|
|
148
|
+
// location.reload()
|
|
149
|
+
if (data) {
|
|
150
|
+
this.refresh();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
async stopSubscribing() {
|
|
156
|
+
var _a;
|
|
157
|
+
await ((_a = this.subscriptionForAutoRefresh) === null || _a === void 0 ? void 0 : _a.unsubscribe());
|
|
158
|
+
delete this.subscriptionForAutoRefresh;
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
BoardPlayerPage.styles = [
|
|
162
|
+
css `
|
|
163
|
+
:host {
|
|
164
|
+
display: flex;
|
|
165
|
+
flex-direction: column;
|
|
166
|
+
width: 100%;
|
|
167
|
+
height: 100%;
|
|
168
|
+
|
|
169
|
+
overflow: hidden;
|
|
170
|
+
position: relative;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
ox-board-player {
|
|
174
|
+
flex: 1;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
oops-spinner {
|
|
178
|
+
display: none;
|
|
179
|
+
position: absolute;
|
|
180
|
+
left: 50%;
|
|
181
|
+
top: 50%;
|
|
182
|
+
transform: translate(-50%, -50%);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
oops-spinner[show] {
|
|
186
|
+
display: block;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
oops-note {
|
|
190
|
+
display: block;
|
|
191
|
+
position: absolute;
|
|
192
|
+
left: 50%;
|
|
193
|
+
top: 50%;
|
|
194
|
+
transform: translate(-50%, -50%);
|
|
195
|
+
}
|
|
196
|
+
`
|
|
197
|
+
];
|
|
198
|
+
__decorate([
|
|
199
|
+
state(),
|
|
200
|
+
__metadata("design:type", Object)
|
|
201
|
+
], BoardPlayerPage.prototype, "data", void 0);
|
|
202
|
+
__decorate([
|
|
203
|
+
state(),
|
|
204
|
+
__metadata("design:type", Object)
|
|
205
|
+
], BoardPlayerPage.prototype, "playGroup", void 0);
|
|
206
|
+
__decorate([
|
|
207
|
+
state(),
|
|
208
|
+
__metadata("design:type", Object)
|
|
209
|
+
], BoardPlayerPage.prototype, "playGroupId", void 0);
|
|
210
|
+
__decorate([
|
|
211
|
+
state(),
|
|
212
|
+
__metadata("design:type", Object)
|
|
213
|
+
], BoardPlayerPage.prototype, "boards", void 0);
|
|
214
|
+
__decorate([
|
|
215
|
+
state(),
|
|
216
|
+
__metadata("design:type", String)
|
|
217
|
+
], BoardPlayerPage.prototype, "baseUrl", void 0);
|
|
218
|
+
__decorate([
|
|
219
|
+
state(),
|
|
220
|
+
__metadata("design:type", Boolean)
|
|
221
|
+
], BoardPlayerPage.prototype, "showSpinner", void 0);
|
|
222
|
+
__decorate([
|
|
223
|
+
query('ox-board-player'),
|
|
224
|
+
__metadata("design:type", BoardPlayer)
|
|
225
|
+
], BoardPlayerPage.prototype, "boardPlayer", void 0);
|
|
226
|
+
BoardPlayerPage = __decorate([
|
|
227
|
+
customElement('board-player-page')
|
|
228
|
+
], BoardPlayerPage);
|
|
229
|
+
export { BoardPlayerPage };
|
|
230
|
+
//# sourceMappingURL=board-player-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"board-player-page.js","sourceRoot":"","sources":["../../client/pages/board-player-page.ts"],"names":[],"mappings":";AAAA,OAAO,kCAAkC,CAAA;AACzC,OAAO,mCAAmC,CAAA;AAE1C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAEtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAE/D,SAAS,UAAU,CAAC,KAAU;IAC5B,KAAK,MAA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AAE,CAAA;iBACf;YACH,CAAC;SACF,CACF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,eAAe;;QACnB,MAAM,CAAA,MAAA,IAAI,CAAC,0BAA0B,0CAAE,WAAW,EAAE,CAAA,CAAA;QACpD,OAAO,IAAI,CAAC,0BAA0B,CAAA;IACxC,CAAC;;AA/MM,sBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkCF;CACF,CAAA;AAED;IAAC,KAAK,EAAE;;6CAAU;AAClB;IAAC,KAAK,EAAE;;kDAAe;AACvB;IAAC,KAAK,EAAE;;oDAA4B;AACpC;IAAC,KAAK,EAAE;;+CAAY;AACpB;IAAC,KAAK,EAAE;;gDAAiB;AACzB;IAAC,KAAK,EAAE;;oDAAsB;AAK9B;IAAC,KAAK,CAAC,iBAAiB,CAAC;8BAAe,WAAW;oDAAA;AAjDxC,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAiN3B;SAjNY,eAAe","sourcesContent":["import './things-scene-components.import'\nimport '@operato/board/ox-board-player.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, state, query } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\n\nimport { createBoardProvider } from '../board-provider'\nimport { store, PageView } from '@operato/shell'\nimport { clientSettingStore } from '@operato/shell/object-store.js'\nimport { client, subscribe } from '@operato/graphql'\nimport { ReferenceMap } from '@hatiolab/things-scene'\nimport { BoardPlayer } from '@operato/board/ox-board-player.js'\n\nfunction parseQuery(query: any) {\n for (const key in query) {\n if (query.hasOwnProperty(key)) {\n try {\n query[key] = JSON.parse(query[key])\n } catch (error) {\n // do nothing\n }\n }\n }\n\n return query\n}\n\n@customElement('board-player-page')\nexport class BoardPlayerPage extends connect(store)(PageView) {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n\n overflow: hidden;\n position: relative;\n }\n\n ox-board-player {\n flex: 1;\n }\n\n oops-spinner {\n display: none;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n }\n\n oops-spinner[show] {\n display: block;\n }\n\n oops-note {\n display: block;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n }\n `\n ]\n\n @state() data: any\n @state() playGroup: any\n @state() playGroupId?: string | null\n @state() boards: any\n @state() baseUrl?: string\n @state() showSpinner?: boolean\n\n private provider?: ReferenceMap<unknown> & { dispose?: () => void }\n private subscriptionForAutoRefresh\n\n @query('ox-board-player') boardPlayer?: BoardPlayer\n\n connectedCallback() {\n super.connectedCallback()\n\n this.provider = createBoardProvider()\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this.provider!.dispose!()\n delete this.provider\n }\n\n async fetch(id: string) {\n return await client.query({\n query: gql`\n query ($id: String!) {\n response: playGroup(id: $id) {\n id\n name\n description\n boards {\n id\n model\n }\n }\n }\n `,\n variables: {\n id\n }\n })\n }\n\n async refresh() {\n if (!this.playGroupId) {\n return\n }\n\n try {\n this.showSpinner = true\n this.updateContext()\n\n const response = await this.fetch(this.playGroupId)\n\n this.playGroup = response.data.response\n\n if (!this.playGroup) {\n throw 'playgroup not found'\n }\n\n this.boards = this.playGroup.boards\n } catch (ex) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n level: 'error',\n message: ex,\n ex\n }\n })\n )\n } finally {\n this.showSpinner = false\n this.updateContext()\n\n const { autoRefresh = true } = (await clientSettingStore.get('board-view'))?.value || {}\n autoRefresh && this.startSubscribingForAutoRefresh()\n }\n }\n\n updated(changes) {\n if (changes.has('playGroupId')) {\n this.boardPlayer!.stop()\n this.refresh()\n }\n }\n\n stateChanged(state) {\n this.baseUrl = state.app.baseUrl\n }\n\n get oopsNote() {\n return {\n icon: 'style',\n title: 'EMPTY PLAYGROUP',\n description: 'There are no board to be shown'\n }\n }\n\n get context() {\n return {\n title: this.playGroup ? this.playGroup.name : this.showSpinner ? 'Fetching playgroup...' : 'Playgroup Not Found'\n }\n }\n\n render() {\n var oops = !this.showSpinner && !this.playGroup && this.oopsNote\n\n return oops\n ? html` <oops-note icon=${oops.icon} title=${oops.title} description=${oops.description}></oops-note> `\n : html`\n <ox-board-player .boards=${this.boards} .data=${this.data} .provider=${this.provider}></ox-board-player>\n <oops-spinner ?show=${this.showSpinner}></oops-spinner>\n `\n }\n\n pageUpdated(changes, lifecycle) {\n if (this.active) {\n this.playGroupId = lifecycle.resourceId\n this.data = parseQuery({ ...lifecycle.params })\n\n this.refresh()\n } else {\n this.stopSubscribing()\n\n this.playGroupId = null\n this.boardPlayer!.stop()\n }\n }\n\n async startSubscribingForAutoRefresh() {\n if (!this.playGroup) {\n return\n }\n\n await this.stopSubscribing()\n\n this.subscriptionForAutoRefresh = await subscribe(\n {\n query: gql`\n subscription ($id: String!) {\n playGroup(id: $id) {\n id\n }\n }\n `,\n variables: {\n id: this.playGroup.id\n }\n },\n {\n next: async ({ data }) => {\n await this.stopSubscribing()\n\n // location.reload()\n if (data) {\n this.refresh()\n }\n }\n }\n )\n }\n\n async stopSubscribing() {\n await this.subscriptionForAutoRefresh?.unsubscribe()\n delete this.subscriptionForAutoRefresh\n }\n}\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import '@operato/data-grist';
|
|
2
|
+
import { PageView } from '@operato/shell';
|
|
3
|
+
import { FetchOption } from '@operato/data-grist';
|
|
4
|
+
declare const BoardTemplateListPage_base: (new (...args: any[]) => {
|
|
5
|
+
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
6
|
+
connectedCallback(): void;
|
|
7
|
+
disconnectedCallback(): void;
|
|
8
|
+
stateChanged(_state: unknown): void;
|
|
9
|
+
readonly isConnected: boolean;
|
|
10
|
+
}) & (new (...args: any[]) => import("lit").LitElement) & typeof PageView & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
|
|
11
|
+
export declare class BoardTemplateListPage extends BoardTemplateListPage_base {
|
|
12
|
+
static styles: import("lit").CSSResult[];
|
|
13
|
+
gristConfig: any;
|
|
14
|
+
visibility: string;
|
|
15
|
+
private grist;
|
|
16
|
+
private sortersControl;
|
|
17
|
+
get context(): {
|
|
18
|
+
title: string;
|
|
19
|
+
search: {
|
|
20
|
+
handler: (search: string) => void;
|
|
21
|
+
value: string;
|
|
22
|
+
};
|
|
23
|
+
filter: {
|
|
24
|
+
handler: () => void;
|
|
25
|
+
};
|
|
26
|
+
board_topmenu: boolean;
|
|
27
|
+
help: string;
|
|
28
|
+
};
|
|
29
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
30
|
+
pageInitialized(lifecycle: any): Promise<void>;
|
|
31
|
+
pageUpdated(changes: any, lifecycle: any): Promise<void>;
|
|
32
|
+
fetchHandler({ page, limit, sortings, filters }: FetchOption): Promise<{
|
|
33
|
+
total: any;
|
|
34
|
+
records: any;
|
|
35
|
+
}>;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import '@operato/data-grist';
|
|
3
|
+
import { CommonGristStyles, ScrollbarStyles } from '@operato/styles';
|
|
4
|
+
import { PageView, store } from '@operato/shell';
|
|
5
|
+
import { css, html } from 'lit';
|
|
6
|
+
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
7
|
+
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
8
|
+
import { DataGrist } from '@operato/data-grist';
|
|
9
|
+
import { client } from '@operato/graphql';
|
|
10
|
+
import { i18next, localize } from '@operato/i18n';
|
|
11
|
+
import { OxPopup } from '@operato/popup';
|
|
12
|
+
import { connect } from 'pwa-helpers/connect-mixin';
|
|
13
|
+
import gql from 'graphql-tag';
|
|
14
|
+
let BoardTemplateListPage = class BoardTemplateListPage extends connect(store)(localize(i18next)(ScopedElementsMixin(PageView))) {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.visibility = '';
|
|
18
|
+
}
|
|
19
|
+
get context() {
|
|
20
|
+
var _a;
|
|
21
|
+
return {
|
|
22
|
+
title: i18next.t('title.board-template list'),
|
|
23
|
+
search: {
|
|
24
|
+
handler: (search) => {
|
|
25
|
+
this.grist.searchText = search;
|
|
26
|
+
},
|
|
27
|
+
value: ((_a = this.grist) === null || _a === void 0 ? void 0 : _a.searchText) || ''
|
|
28
|
+
},
|
|
29
|
+
filter: {
|
|
30
|
+
handler: () => {
|
|
31
|
+
this.grist.toggleHeadroom();
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
board_topmenu: true,
|
|
35
|
+
help: 'board-service/board-template'
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
return html `
|
|
40
|
+
<ox-grist mode="CARD" .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
41
|
+
<div slot="headroom">
|
|
42
|
+
<div id="filters">
|
|
43
|
+
<ox-filters-form autofocus without-search></ox-filters-form>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</ox-grist>
|
|
47
|
+
`;
|
|
48
|
+
}
|
|
49
|
+
async pageInitialized(lifecycle) {
|
|
50
|
+
this.gristConfig = {
|
|
51
|
+
list: {
|
|
52
|
+
thumbnail: 'thumbnail',
|
|
53
|
+
fields: ['name', 'description'],
|
|
54
|
+
details: ['visibility', 'creator', 'createdAt']
|
|
55
|
+
},
|
|
56
|
+
columns: [
|
|
57
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
58
|
+
{
|
|
59
|
+
type: 'string',
|
|
60
|
+
name: 'name',
|
|
61
|
+
header: i18next.t('field.name'),
|
|
62
|
+
record: {
|
|
63
|
+
editable: false
|
|
64
|
+
},
|
|
65
|
+
filter: 'search',
|
|
66
|
+
sortable: true,
|
|
67
|
+
width: 150
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
type: 'string',
|
|
71
|
+
name: 'description',
|
|
72
|
+
header: i18next.t('field.description'),
|
|
73
|
+
record: {
|
|
74
|
+
editable: false
|
|
75
|
+
},
|
|
76
|
+
filter: 'search',
|
|
77
|
+
width: 200
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
type: 'boolean',
|
|
81
|
+
name: 'mine',
|
|
82
|
+
record: {
|
|
83
|
+
editable: false
|
|
84
|
+
},
|
|
85
|
+
hidden: true,
|
|
86
|
+
width: 0
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
type: 'select-buttons',
|
|
90
|
+
name: 'visibility',
|
|
91
|
+
header: i18next.t('field.visibility'),
|
|
92
|
+
label: true,
|
|
93
|
+
record: {
|
|
94
|
+
editable: false
|
|
95
|
+
},
|
|
96
|
+
filter: {
|
|
97
|
+
operator: 'in',
|
|
98
|
+
options: ['private', 'public', 'domain'],
|
|
99
|
+
value: this.visibility,
|
|
100
|
+
label: '' /* empty intentionally */
|
|
101
|
+
},
|
|
102
|
+
width: 200
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
type: 'image',
|
|
106
|
+
name: 'thumbnail',
|
|
107
|
+
header: i18next.t('field.thumbnail'),
|
|
108
|
+
record: {
|
|
109
|
+
editable: false
|
|
110
|
+
},
|
|
111
|
+
width: 200
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
type: 'resource-object',
|
|
115
|
+
name: 'creator',
|
|
116
|
+
header: i18next.t('field.creator'),
|
|
117
|
+
label: true,
|
|
118
|
+
record: {
|
|
119
|
+
editable: false
|
|
120
|
+
},
|
|
121
|
+
sortable: true,
|
|
122
|
+
width: 120
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
type: 'datetime',
|
|
126
|
+
name: 'createdAt',
|
|
127
|
+
header: i18next.t('field.created_at'),
|
|
128
|
+
label: true,
|
|
129
|
+
record: {
|
|
130
|
+
editable: false
|
|
131
|
+
},
|
|
132
|
+
sortable: true,
|
|
133
|
+
width: 180
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
rows: {
|
|
137
|
+
selectable: false,
|
|
138
|
+
appendable: false
|
|
139
|
+
},
|
|
140
|
+
sorters: [
|
|
141
|
+
{
|
|
142
|
+
name: 'name'
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
async pageUpdated(changes, lifecycle) {
|
|
148
|
+
if (this.active) {
|
|
149
|
+
this.grist.fetch();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }) {
|
|
153
|
+
const response = await client.query({
|
|
154
|
+
query: gql `
|
|
155
|
+
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
156
|
+
responses: boardTemplates(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
157
|
+
items {
|
|
158
|
+
id
|
|
159
|
+
name
|
|
160
|
+
description
|
|
161
|
+
model
|
|
162
|
+
thumbnail
|
|
163
|
+
visibility
|
|
164
|
+
mine
|
|
165
|
+
creator {
|
|
166
|
+
id
|
|
167
|
+
name
|
|
168
|
+
}
|
|
169
|
+
createdAt
|
|
170
|
+
}
|
|
171
|
+
total
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
`,
|
|
175
|
+
variables: {
|
|
176
|
+
filters,
|
|
177
|
+
pagination: { page, limit },
|
|
178
|
+
sortings
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
return {
|
|
182
|
+
total: response.data.responses.total || 0,
|
|
183
|
+
records: response.data.responses.items || []
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
BoardTemplateListPage.styles = [
|
|
188
|
+
ScrollbarStyles,
|
|
189
|
+
CommonGristStyles,
|
|
190
|
+
css `
|
|
191
|
+
:host {
|
|
192
|
+
display: flex;
|
|
193
|
+
|
|
194
|
+
width: 100%;
|
|
195
|
+
|
|
196
|
+
--grid-record-emphasized-background-color: #8b0000;
|
|
197
|
+
--grid-record-emphasized-color: #ff6b6b;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
ox-grist {
|
|
201
|
+
overflow-y: auto;
|
|
202
|
+
flex: 1;
|
|
203
|
+
}
|
|
204
|
+
`
|
|
205
|
+
];
|
|
206
|
+
__decorate([
|
|
207
|
+
property({ type: Object }),
|
|
208
|
+
__metadata("design:type", Object)
|
|
209
|
+
], BoardTemplateListPage.prototype, "gristConfig", void 0);
|
|
210
|
+
__decorate([
|
|
211
|
+
state(),
|
|
212
|
+
__metadata("design:type", String)
|
|
213
|
+
], BoardTemplateListPage.prototype, "visibility", void 0);
|
|
214
|
+
__decorate([
|
|
215
|
+
query('ox-grist'),
|
|
216
|
+
__metadata("design:type", DataGrist)
|
|
217
|
+
], BoardTemplateListPage.prototype, "grist", void 0);
|
|
218
|
+
__decorate([
|
|
219
|
+
query('#sorter-control'),
|
|
220
|
+
__metadata("design:type", OxPopup)
|
|
221
|
+
], BoardTemplateListPage.prototype, "sortersControl", void 0);
|
|
222
|
+
BoardTemplateListPage = __decorate([
|
|
223
|
+
customElement('board-template-list-page')
|
|
224
|
+
], BoardTemplateListPage);
|
|
225
|
+
export { BoardTemplateListPage };
|
|
226
|
+
//# sourceMappingURL=board-template-list-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"board-template-list-page.js","sourceRoot":"","sources":["../../../client/pages/board-template/board-template-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO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CAAC;YAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;OAoBT;YACD,SAAS,EAAE;gBACT,OAAO;gBACP,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;gBAC3B,QAAQ;aACT;SACF,CAAC,CAAA;QAEF,OAAO;YACL,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;YACzC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;SAC7C,CAAA;IACH,CAAC;;AApMM,4BAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;KAcF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0DAAiB;AAC5C;IAAC,KAAK,EAAE;;yDAAwB;AAEhC;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;oDAAA;AAC5C;IAAC,KAAK,CAAC,iBAAiB,CAAC;8BAA0B,OAAO;6DAAA;AAzB/C,qBAAqB;IADjC,aAAa,CAAC,0BAA0B,CAAC;GAC7B,qBAAqB,CAsMjC;SAtMY,qBAAqB","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView, store } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { DataGrist, FetchOption, getEditor, getRenderer } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify } from '@operato/layout'\nimport { OxPopup } from '@operato/popup'\n\nimport { connect } from 'pwa-helpers/connect-mixin'\nimport gql from 'graphql-tag'\nimport { useMutation } from '@apollo/client'\n\n@customElement('board-template-list-page')\nexport class BoardTemplateListPage extends connect(store)(localize(i18next)(ScopedElementsMixin(PageView))) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: #8b0000;\n --grid-record-emphasized-color: #ff6b6b;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n @property({ type: Object }) gristConfig: any\n @state() visibility: string = ''\n\n @query('ox-grist') private grist!: DataGrist\n @query('#sorter-control') private sortersControl!: OxPopup\n\n get context() {\n return {\n title: i18next.t('title.board-template list'),\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n board_topmenu: true,\n help: 'board-service/board-template'\n }\n }\n\n render() {\n return html`\n <ox-grist mode=\"CARD\" .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\">\n <div id=\"filters\">\n <ox-filters-form autofocus without-search></ox-filters-form>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle: any) {\n this.gristConfig = {\n list: {\n thumbnail: 'thumbnail',\n fields: ['name', 'description'],\n details: ['visibility', 'creator', 'createdAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: false\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: false\n },\n filter: 'search',\n width: 200\n },\n {\n type: 'boolean',\n name: 'mine',\n record: {\n editable: false\n },\n hidden: true,\n width: 0\n },\n {\n type: 'select-buttons',\n name: 'visibility',\n header: i18next.t('field.visibility'),\n label: true,\n record: {\n editable: false\n },\n filter: {\n operator: 'in',\n options: ['private', 'public', 'domain'],\n value: this.visibility,\n label: '' /* empty intentionally */\n },\n width: 200\n },\n {\n type: 'image',\n name: 'thumbnail',\n header: i18next.t('field.thumbnail'),\n record: {\n editable: false\n },\n width: 200\n },\n {\n type: 'resource-object',\n name: 'creator',\n header: i18next.t('field.creator'),\n label: true,\n record: {\n editable: false\n },\n sortable: true,\n width: 120\n },\n {\n type: 'datetime',\n name: 'createdAt',\n header: i18next.t('field.created_at'),\n label: true,\n record: {\n editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: false,\n appendable: false\n },\n sorters: [\n {\n name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (this.active) {\n this.grist.fetch()\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: boardTemplates(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n description\n model\n thumbnail\n visibility\n mine\n creator {\n id\n name\n }\n createdAt\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import gql from 'graphql-tag';
|
|
3
|
+
import { customElement } from 'lit/decorators.js';
|
|
4
|
+
import { client, gqlContext } from '@operato/graphql';
|
|
5
|
+
import { BoardViewerPage } from './board-viewer-page';
|
|
6
|
+
let BoardViewerByNamePage = class BoardViewerByNamePage extends BoardViewerPage {
|
|
7
|
+
async fetch(name) {
|
|
8
|
+
return await client.query({
|
|
9
|
+
query: gql `
|
|
10
|
+
query FetchBoardByName($name: String!) {
|
|
11
|
+
response: boardByName(name: $name) {
|
|
12
|
+
id
|
|
13
|
+
name
|
|
14
|
+
model
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`,
|
|
18
|
+
variables: { name },
|
|
19
|
+
context: gqlContext()
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
BoardViewerByNamePage = __decorate([
|
|
24
|
+
customElement('board-viewer-by-name-page')
|
|
25
|
+
], BoardViewerByNamePage);
|
|
26
|
+
export { BoardViewerByNamePage };
|
|
27
|
+
//# sourceMappingURL=board-viewer-by-name-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"board-viewer-by-name-page.js","sourceRoot":"","sources":["../../client/pages/board-viewer-by-name-page.ts"],"names":[],"mappings":";AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAG9C,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,eAAe;IACxD,KAAK,CAAC,KAAK,CAAC,IAAY;QACtB,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC;YACxB,KAAK,EAAE,GAAG,CAAA;;;;;;;;OAQT;YACD,SAAS,EAAE,EAAE,IAAI,EAAE;YACnB,OAAO,EAAE,UAAU,EAAE;SACtB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAhBY,qBAAqB;IADjC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,qBAAqB,CAgBjC;SAhBY,qBAAqB","sourcesContent":["import gql from 'graphql-tag'\nimport { customElement } from 'lit/decorators.js'\nimport { client, gqlContext } from '@operato/graphql'\n\nimport { BoardViewerPage } from './board-viewer-page'\n\n@customElement('board-viewer-by-name-page')\nexport class BoardViewerByNamePage extends BoardViewerPage {\n async fetch(name: string) {\n return await client.query({\n query: gql`\n query FetchBoardByName($name: String!) {\n response: boardByName(name: $name) {\n id\n name\n model\n }\n }\n `,\n variables: { name },\n context: gqlContext()\n })\n }\n}\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import './things-scene-components.import';
|
|
2
|
+
import '@operato/board/ox-board-viewer.js';
|
|
3
|
+
import { BoardViewer } from '@operato/board';
|
|
4
|
+
import { PageView } from '@operato/shell';
|
|
5
|
+
declare const BoardViewerPage_base: (new (...args: any[]) => {
|
|
6
|
+
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
disconnectedCallback(): void;
|
|
9
|
+
stateChanged(_state: unknown): void;
|
|
10
|
+
readonly isConnected: boolean;
|
|
11
|
+
}) & typeof PageView;
|
|
12
|
+
export declare class BoardViewerPage extends BoardViewerPage_base {
|
|
13
|
+
static styles: import("lit").CSSResult[];
|
|
14
|
+
_board: any;
|
|
15
|
+
_boardId?: string;
|
|
16
|
+
_baseUrl?: string;
|
|
17
|
+
_interactive?: boolean;
|
|
18
|
+
_showSpinner?: boolean;
|
|
19
|
+
data: any;
|
|
20
|
+
subscriptionForAutoRefresh: any;
|
|
21
|
+
boardViewer: BoardViewer;
|
|
22
|
+
get oopsNote(): {
|
|
23
|
+
icon: string;
|
|
24
|
+
title: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
get context(): {
|
|
28
|
+
title: any;
|
|
29
|
+
};
|
|
30
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
31
|
+
updated(changes: any): void;
|
|
32
|
+
pageUpdated(changes: any, lifecycle: any): void;
|
|
33
|
+
stateChanged(state: any): void;
|
|
34
|
+
fetch(id: string): Promise<import("@apollo/client").ApolloQueryResult<any>>;
|
|
35
|
+
refresh(): Promise<void>;
|
|
36
|
+
startSubscribingForAutoRefresh(): Promise<void>;
|
|
37
|
+
stopSubscribing(): Promise<void>;
|
|
38
|
+
getGrf(): Promise<string>;
|
|
39
|
+
printTrick(image: any): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
export {};
|