@operato/process 7.1.30 → 7.1.32

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/tsconfig.tsbuildinfo +1 -1
  3. package/package.json +14 -14
  4. package/.storybook/main.js +0 -3
  5. package/.storybook/preview.js +0 -52
  6. package/.storybook/server.mjs +0 -8
  7. package/demo/index-modeller.html +0 -112
  8. package/demo/index-viewer.html +0 -112
  9. package/demo/index.html +0 -112
  10. package/src/data-storage/data-storage.ts +0 -47
  11. package/src/graphql/data-subscription.ts +0 -30
  12. package/src/graphql/favorite-process.ts +0 -25
  13. package/src/graphql/index.ts +0 -3
  14. package/src/graphql/process-group.ts +0 -138
  15. package/src/graphql/process.ts +0 -141
  16. package/src/graphql/scenario.ts +0 -79
  17. package/src/index.ts +0 -8
  18. package/src/modeller/component-toolbar/component-detail.ts +0 -58
  19. package/src/modeller/component-toolbar/component-menu.ts +0 -193
  20. package/src/modeller/component-toolbar/component-toolbar.ts +0 -196
  21. package/src/modeller/component-toolbar/mode-icons.ts +0 -88
  22. package/src/modeller/edit-toolbar-style.ts +0 -229
  23. package/src/modeller/edit-toolbar.ts +0 -576
  24. package/src/modeller/property-sidebar/abstract-property.ts +0 -69
  25. package/src/modeller/property-sidebar/data-binding/data-binding-mapper.ts +0 -475
  26. package/src/modeller/property-sidebar/data-binding/data-binding.ts +0 -479
  27. package/src/modeller/property-sidebar/effects/effects-shared-style.ts +0 -62
  28. package/src/modeller/property-sidebar/effects/effects.ts +0 -52
  29. package/src/modeller/property-sidebar/effects/property-event-hover.ts +0 -201
  30. package/src/modeller/property-sidebar/effects/property-event-tap.ts +0 -212
  31. package/src/modeller/property-sidebar/effects/property-event.ts +0 -76
  32. package/src/modeller/property-sidebar/effects/property-shadow.ts +0 -114
  33. package/src/modeller/property-sidebar/effects/value-converter.ts +0 -23
  34. package/src/modeller/property-sidebar/inspector/inspector.ts +0 -408
  35. package/src/modeller/property-sidebar/property-shared-style.ts +0 -136
  36. package/src/modeller/property-sidebar/property-sidebar.ts +0 -342
  37. package/src/modeller/property-sidebar/shapes/box-padding-editor-styles.ts +0 -94
  38. package/src/modeller/property-sidebar/shapes/shapes.ts +0 -410
  39. package/src/modeller/property-sidebar/specifics/specific-properties-builder.ts +0 -147
  40. package/src/modeller/property-sidebar/specifics/specifics.ts +0 -81
  41. package/src/modeller/property-sidebar/styles/styles.ts +0 -577
  42. package/src/ox-editor-process-selector.ts +0 -91
  43. package/src/ox-process-list.ts +0 -401
  44. package/src/ox-process-modeller.ts +0 -432
  45. package/src/ox-process-template-list.ts +0 -272
  46. package/src/ox-process-template-viewer.ts +0 -198
  47. package/src/ox-process-viewer.ts +0 -575
  48. package/src/ox-property-editor-process-selector.ts +0 -23
  49. package/src/selector/ox-process-creation-card.ts +0 -95
  50. package/src/selector/ox-process-selector.ts +0 -324
  51. package/src/selector/process-creation-popup.ts +0 -151
  52. package/src/selector/process-thumbnail-card.ts +0 -175
  53. package/src/types.ts +0 -57
  54. package/stories/index.stories.ts +0 -54
  55. package/tsconfig.json +0 -24
  56. package/web-dev-server.config.mjs +0 -30
  57. package/web-test-runner.config.mjs +0 -29
@@ -1,401 +0,0 @@
1
- import '@operato/popup/ox-popup.js'
2
- import '@operato/data-grist'
3
-
4
- import { css, html, LitElement } from 'lit'
5
- import { customElement, property, query, state } from 'lit/decorators.js'
6
-
7
- import { ColumnConfig, DataGrist, FetchOption, GristData, GristRecord, SortersConfig } from '@operato/data-grist'
8
- import { OxPopup } from '@operato/popup'
9
-
10
- import { createProcess, fetchProcessList } from './graphql/process'
11
- import { fetchFavoriteProcessList } from './graphql/favorite-process'
12
- import { fetchProcessGroupList } from './graphql/process-group'
13
- import { Process } from './types'
14
-
15
- @customElement('ox-process-list')
16
- class ProcessList extends LitElement {
17
- static styles = css`
18
- :host {
19
- display: flex;
20
-
21
- width: 100%;
22
-
23
- --grid-record-emphasized-background-color: red;
24
- --grid-record-emphasized-color: yellow;
25
- }
26
-
27
- ox-grist {
28
- flex: 1;
29
- overflow-y: auto;
30
-
31
- --grid-record-emphasized-background-color: red;
32
- --grid-record-emphasized-color: yellow;
33
- }
34
-
35
- #headroom {
36
- display: flex;
37
- flex-direction: row;
38
- align-items: center;
39
- padding: var(--padding-default) var(--spacing-large);
40
- border-top: 2px solid rgba(0, 0, 0, 0.2);
41
- background-color: var(--md-sys-color-surface);
42
- box-shadow: var(--box-shadow);
43
- }
44
-
45
- #filters {
46
- flex: 1;
47
- --md-icon-size: 20px;
48
- }
49
- #mode {
50
- width: 100px;
51
- }
52
- #add {
53
- width: 50px;
54
- text-align: right;
55
- }
56
-
57
- #modes > * {
58
- padding: var(--spacing-small);
59
- font-size: 1em;
60
- opacity: 0.5;
61
- color: var(--md-sys-color-on-primary-container);
62
- cursor: pointer;
63
- }
64
-
65
- #modes > md-icon[active] {
66
- border-radius: 9px;
67
- background-color: rgba(var(--primary-color-rgb), 0.05);
68
- opacity: 1;
69
- color: var(--md-sys-color-on-secondary-container);
70
- cursor: default;
71
- }
72
- #modes > md-icon:hover {
73
- opacity: 1;
74
- color: var(--md-sys-color-on-secondary-container);
75
- }
76
-
77
- #add button {
78
- display: flex;
79
- align-items: center;
80
- justify-content: center;
81
-
82
- background-color: var(--md-sys-color-primary-container);
83
- color: var(--md-sys-color-on-primary-container);
84
- border: 0;
85
- border-radius: 50%;
86
- padding: 5px;
87
- width: 32px;
88
- height: 32px;
89
- cursor: pointer;
90
- }
91
-
92
- #add button:hover {
93
- background-color: var(--md-sys-color-on-primary-container);
94
- color: var(--md-sys-color-primary-container);
95
- box-shadow: var(--box-shadow);
96
- }
97
-
98
- #add button md-icon {
99
- font-size: 1.5em;
100
- }
101
-
102
- #filters {
103
- position: relative;
104
- }
105
- #filters [type='text'] {
106
- background-color: transparent;
107
- border: 0;
108
- border-bottom: var(--border-dim-color);
109
- padding: var(--spacing-small) var(--spacing-small) 7px 25px;
110
- font-size: var(--fontsize-large);
111
- }
112
- #filters [type='text']:focus {
113
- outline: none;
114
- }
115
- #filters md-icon {
116
- position: absolute;
117
- top: 3px;
118
- color: var(--md-sys-color-on-secondary-container);
119
- }
120
- #filters * {
121
- margin-right: var(--spacing-medium);
122
- }
123
-
124
- @media only screen and (max-width: 460px) {
125
- #modes {
126
- display: none;
127
- }
128
- }
129
- `
130
-
131
- @property({ type: Boolean }) creatable: boolean = false
132
- @property({ type: Object }) config: any
133
- @property({ type: Object }) data: any
134
- @property({ type: String }) mode: 'GRID' | 'LIST' | 'CARD' = 'CARD'
135
- @property({ type: String }) groupId?: string
136
- @property({ type: Array }) groups: any[] = []
137
- @property({ type: Array }) favorites: any[] = []
138
-
139
- @query('ox-grist') grist!: DataGrist
140
-
141
- render() {
142
- const mode = this.mode || 'CARD'
143
-
144
- return html`
145
- <ox-grist .config=${this.config} .mode=${mode} auto-fetch .fetchHandler=${this.fetchHandler.bind(this)}>
146
- <div slot="headroom" id="headroom">
147
- <div id="filters">
148
- <md-icon>search</md-icon>
149
- <input type="text" />
150
-
151
- <select
152
- @change=${(e: Event) => {
153
- this.groupId = (e.currentTarget as HTMLInputElement).value
154
- this.requestUpdate()
155
- }}
156
- >
157
- <option value="">*</option>
158
- ${this.groups.map(
159
- group => html`
160
- <option value=${group.id} ?selected=${group.id === this.groupId}>${group.description}</option>
161
- `
162
- )}
163
- </select>
164
- </div>
165
-
166
- <div id="modes">
167
- <md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
168
- <md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
169
- <md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
170
- </div>
171
-
172
- ${this.creatable
173
- ? html`
174
- <div id="add">
175
- <button><md-icon @click=${() => this.onCreateProcess()}>add</md-icon></button>
176
- </div>
177
- `
178
- : undefined}
179
- </div>
180
- </ox-grist>
181
- `
182
- }
183
-
184
- async fetchHandler({ page, limit, sorters = [] }: FetchOption) {
185
- const { items: records, total } = await this.getProcesses({ page, limit, sorters })
186
-
187
- return {
188
- total,
189
- records
190
- }
191
- }
192
-
193
- get gristConfig() {
194
- return {
195
- list: {
196
- thumbnail: function (record: GristRecord, rowIndex: number) {
197
- return html` <img src=${record.thumbnail} style="width: 100%; height: 100%;" /> `
198
- },
199
- fields: ['name', 'description'],
200
- details: ['updatedAt']
201
- },
202
- columns: [
203
- {
204
- type: 'gutter',
205
- gutterName: 'dirty'
206
- },
207
- {
208
- type: 'gutter',
209
- gutterName: 'sequence'
210
- },
211
- {
212
- type: 'string',
213
- name: 'id',
214
- hidden: true
215
- },
216
- {
217
- type: 'string',
218
- name: 'name',
219
- header: 'name',
220
- record: {
221
- editable: true,
222
- align: 'left'
223
- },
224
- width: 200,
225
- sortable: true
226
- },
227
- {
228
- type: 'string',
229
- name: 'description',
230
- header: 'description',
231
- record: {
232
- editable: true,
233
- align: 'left'
234
- },
235
- width: 200
236
- },
237
- {
238
- type: 'boolean',
239
- name: 'active',
240
- header: 'active',
241
- record: {
242
- editable: true
243
- },
244
- sortable: true,
245
- width: 60
246
- },
247
- {
248
- type: 'datetime',
249
- name: 'updatedAt',
250
- header: 'updated at',
251
- record: {
252
- editable: true
253
- },
254
- sortable: true,
255
- width: 180
256
- },
257
- {
258
- type: 'datetime',
259
- name: 'createdAt',
260
- header: 'created at',
261
- record: {
262
- editable: true
263
- },
264
- sortable: true,
265
- width: 180
266
- }
267
- ],
268
- rows: {
269
- selectable: {
270
- multiple: true
271
- }
272
- },
273
- sorters: [
274
- {
275
- name: 'name',
276
- desc: false
277
- }
278
- ],
279
- pagination: {
280
- pages: [20, 30, 50, 100, 200]
281
- }
282
- }
283
- }
284
-
285
- async refresh() {
286
- this.groups = (await fetchProcessGroupList()).processGroups.items
287
-
288
- if (this.groups) {
289
- await this.refreshProcesses()
290
- }
291
- }
292
-
293
- async getProcesses({
294
- page = 1,
295
- limit = 30,
296
- sorters = []
297
- }: { page?: number; limit?: number; sorters?: SortersConfig } = {}) {
298
- if (this.groupId && this.groupId == 'favor')
299
- return await this.getFavoriteProcesses({
300
- page,
301
- limit
302
- })
303
-
304
- var listParam = {
305
- filters: this.groupId
306
- ? [
307
- {
308
- name: 'groupId',
309
- operator: 'eq',
310
- value: this.groupId
311
- }
312
- ]
313
- : [],
314
- sortings: sorters,
315
- pagination: {
316
- page,
317
- limit
318
- }
319
- }
320
-
321
- return (await fetchProcessList(listParam)).processes
322
- }
323
-
324
- async getFavoriteProcesses({ page = 1, limit = 30 } = {}) {
325
- var listParam = {
326
- pagination: {
327
- page,
328
- limit
329
- }
330
- }
331
-
332
- return (await fetchFavoriteProcessList(listParam)).favoriteProcesses
333
- }
334
-
335
- async refreshProcesses() {
336
- if (!this.groups) {
337
- await this.refresh()
338
- return
339
- }
340
-
341
- this.grist.fetch()
342
- }
343
-
344
- async onCreateProcess() {
345
- /*
346
- * 기존 설정된 이미지가 선택된 상태가 되게 하기 위해서는 selector에 value를 전달해줄 필요가 있음.
347
- * 주의. value는 object일 수도 있고, string일 수도 있다.
348
- * string인 경우에는 해당 보드의 id로 해석한다.
349
- */
350
- var template = html`
351
- <process-creation-popup
352
- .defaultGroup=${this.groupId}
353
- .groups=${this.groups}
354
- @create-process=${async (e: CustomEvent) => {
355
- try {
356
- var { name, description, groupId, model, thumbnail } = e.detail
357
-
358
- var process: Process = {
359
- name,
360
- description,
361
- groupId,
362
- model: model || {
363
- width: 1600,
364
- height: 1200
365
- },
366
- thumbnail
367
- }
368
-
369
- await createProcess(process)
370
-
371
- this.notify('info', 'new process created')
372
- } catch (ex: Error | any) {
373
- console.error(ex)
374
- this.notify('error', ex, ex)
375
- }
376
- }}
377
- ></process-creation-popup>
378
- `
379
-
380
- OxPopup.open({
381
- template,
382
- parent: this
383
- })
384
-
385
- requestAnimationFrame(() => {
386
- dispatchEvent(new Event('resize'))
387
- })
388
- }
389
-
390
- notify(level: 'warn' | 'error' | 'info', message: any, ex?: Error) {
391
- document.dispatchEvent(
392
- new CustomEvent('notify', {
393
- detail: {
394
- level,
395
- message,
396
- ex
397
- }
398
- })
399
- )
400
- }
401
- }