@things-factory/kpi 9.0.28 → 9.0.29

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 (83) hide show
  1. package/client/pages/kpi-statistic/kpi-statistic-editor-page.ts +761 -0
  2. package/client/pages/kpi-statistic/kpi-statistic-importer.ts +90 -0
  3. package/client/pages/kpi-statistic/kpi-statistic-list-page.ts +505 -0
  4. package/client/route.ts +8 -0
  5. package/dist-client/pages/kpi-statistic/kpi-statistic-editor-page.d.ts +53 -0
  6. package/dist-client/pages/kpi-statistic/kpi-statistic-editor-page.js +718 -0
  7. package/dist-client/pages/kpi-statistic/kpi-statistic-editor-page.js.map +1 -0
  8. package/dist-client/pages/kpi-statistic/kpi-statistic-importer.d.ts +23 -0
  9. package/dist-client/pages/kpi-statistic/kpi-statistic-importer.js +92 -0
  10. package/dist-client/pages/kpi-statistic/kpi-statistic-importer.js.map +1 -0
  11. package/dist-client/pages/kpi-statistic/kpi-statistic-list-page.d.ts +66 -0
  12. package/dist-client/pages/kpi-statistic/kpi-statistic-list-page.js +487 -0
  13. package/dist-client/pages/kpi-statistic/kpi-statistic-list-page.js.map +1 -0
  14. package/dist-client/route.d.ts +1 -1
  15. package/dist-client/route.js +6 -0
  16. package/dist-client/route.js.map +1 -1
  17. package/dist-client/tsconfig.tsbuildinfo +1 -1
  18. package/dist-server/service/index.d.ts +3 -2
  19. package/dist-server/service/index.js +4 -0
  20. package/dist-server/service/index.js.map +1 -1
  21. package/dist-server/service/kpi/kpi-mutation.js +9 -0
  22. package/dist-server/service/kpi/kpi-mutation.js.map +1 -1
  23. package/dist-server/service/kpi/kpi-query.js +2 -0
  24. package/dist-server/service/kpi/kpi-query.js.map +1 -1
  25. package/dist-server/service/kpi-alert/kpi-alert-query.js +1 -0
  26. package/dist-server/service/kpi-alert/kpi-alert-query.js.map +1 -1
  27. package/dist-server/service/kpi-category/kpi-category-mutation.js +4 -0
  28. package/dist-server/service/kpi-category/kpi-category-mutation.js.map +1 -1
  29. package/dist-server/service/kpi-category/kpi-category-query.js +2 -0
  30. package/dist-server/service/kpi-category/kpi-category-query.js.map +1 -1
  31. package/dist-server/service/kpi-metric/kpi-metric-mutation.js +6 -0
  32. package/dist-server/service/kpi-metric/kpi-metric-mutation.js.map +1 -1
  33. package/dist-server/service/kpi-metric/kpi-metric-query.js +2 -0
  34. package/dist-server/service/kpi-metric/kpi-metric-query.js.map +1 -1
  35. package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js +7 -0
  36. package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js.map +1 -1
  37. package/dist-server/service/kpi-metric-value/kpi-metric-value-query.js +2 -0
  38. package/dist-server/service/kpi-metric-value/kpi-metric-value-query.js.map +1 -1
  39. package/dist-server/service/kpi-statistic/index.d.ts +6 -0
  40. package/dist-server/service/kpi-statistic/index.js +10 -0
  41. package/dist-server/service/kpi-statistic/index.js.map +1 -0
  42. package/dist-server/service/kpi-statistic/kpi-statistic-mutation.d.ts +10 -0
  43. package/dist-server/service/kpi-statistic/kpi-statistic-mutation.js +198 -0
  44. package/dist-server/service/kpi-statistic/kpi-statistic-mutation.js.map +1 -0
  45. package/dist-server/service/kpi-statistic/kpi-statistic-query.d.ts +13 -0
  46. package/dist-server/service/kpi-statistic/kpi-statistic-query.js +92 -0
  47. package/dist-server/service/kpi-statistic/kpi-statistic-query.js.map +1 -0
  48. package/dist-server/service/kpi-statistic/kpi-statistic-type.d.ts +59 -0
  49. package/dist-server/service/kpi-statistic/kpi-statistic-type.js +200 -0
  50. package/dist-server/service/kpi-statistic/kpi-statistic-type.js.map +1 -0
  51. package/dist-server/service/kpi-statistic/kpi-statistic.d.ts +38 -0
  52. package/dist-server/service/kpi-statistic/kpi-statistic.js +177 -0
  53. package/dist-server/service/kpi-statistic/kpi-statistic.js.map +1 -0
  54. package/dist-server/service/kpi-value/kpi-value-mutation.js +9 -0
  55. package/dist-server/service/kpi-value/kpi-value-mutation.js.map +1 -1
  56. package/dist-server/service/kpi-value/kpi-value-query.js +2 -0
  57. package/dist-server/service/kpi-value/kpi-value-query.js.map +1 -1
  58. package/dist-server/tsconfig.tsbuildinfo +1 -1
  59. package/helps/kpi/kpi-statistic.md +160 -0
  60. package/package.json +2 -2
  61. package/server/service/index.ts +8 -0
  62. package/server/service/kpi/kpi-mutation.ts +9 -0
  63. package/server/service/kpi/kpi-query.ts +2 -0
  64. package/server/service/kpi-alert/kpi-alert-query.ts +2 -1
  65. package/server/service/kpi-category/kpi-category-mutation.ts +4 -0
  66. package/server/service/kpi-category/kpi-category-query.ts +2 -0
  67. package/server/service/kpi-metric/kpi-metric-mutation.ts +6 -0
  68. package/server/service/kpi-metric/kpi-metric-query.ts +2 -0
  69. package/server/service/kpi-metric-value/kpi-metric-value-mutation.ts +7 -0
  70. package/server/service/kpi-metric-value/kpi-metric-value-query.ts +3 -1
  71. package/server/service/kpi-statistic/index.ts +7 -0
  72. package/server/service/kpi-statistic/kpi-statistic-mutation.ts +194 -0
  73. package/server/service/kpi-statistic/kpi-statistic-query.ts +59 -0
  74. package/server/service/kpi-statistic/kpi-statistic-type.ts +152 -0
  75. package/server/service/kpi-statistic/kpi-statistic.ts +167 -0
  76. package/server/service/kpi-value/kpi-value-mutation.ts +9 -0
  77. package/server/service/kpi-value/kpi-value-query.ts +2 -0
  78. package/things-factory.config.js +3 -1
  79. package/translations/en.json +23 -1
  80. package/translations/ja.json +42 -20
  81. package/translations/ko.json +29 -7
  82. package/translations/ms.json +34 -12
  83. package/translations/zh.json +38 -16
@@ -0,0 +1,90 @@
1
+ import '@material/web/icon/icon.js'
2
+ import '@operato/data-grist'
3
+
4
+ import gql from 'graphql-tag'
5
+ import { css, html, LitElement } from 'lit'
6
+ import { property } from 'lit/decorators.js'
7
+
8
+ import { client } from '@operato/graphql'
9
+ import { i18next } from '@operato/i18n'
10
+ import { isMobileDevice } from '@operato/utils'
11
+ import { ButtonContainerStyles } from '@operato/styles'
12
+
13
+ export class KpiStatisticImporter extends LitElement {
14
+ static styles = [
15
+ ButtonContainerStyles,
16
+ css`
17
+ :host {
18
+ display: flex;
19
+ flex-direction: column;
20
+
21
+ background-color: #fff;
22
+ }
23
+
24
+ ox-grist {
25
+ flex: 1;
26
+ }
27
+ `
28
+ ]
29
+
30
+ @property({ type: Array }) kpiStatistics: any[] = []
31
+ @property({ type: Object }) columns = {
32
+ list: { fields: ['name', 'description'] },
33
+ pagination: { infinite: true },
34
+ columns: [
35
+ {
36
+ type: 'string',
37
+ name: 'name',
38
+ header: i18next.t('field.name'),
39
+ width: 150
40
+ },
41
+ {
42
+ type: 'string',
43
+ name: 'description',
44
+ header: i18next.t('field.description'),
45
+ width: 200
46
+ },
47
+ {
48
+ type: 'checkbox',
49
+ name: 'active',
50
+ header: i18next.t('field.active'),
51
+ width: 60
52
+ }
53
+ ]
54
+ }
55
+
56
+
57
+ render() {
58
+ return html`
59
+ <ox-grist
60
+ .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
61
+ .config=${this.columns}
62
+ .data=${
63
+ {
64
+ records: this.kpiStatistics
65
+ }
66
+ }
67
+ ></ox-grist>
68
+
69
+ <div class="button-container">
70
+ <button @click="${this.save.bind(this)}"><md-icon>save</md-icon>${i18next.t('button.save')}</button>
71
+ </div>
72
+ `
73
+ }
74
+
75
+ async save() {
76
+ const response = await client.mutate({
77
+ mutation: gql`
78
+ mutation importKpiStatistics($kpiStatistics: [KpiStatisticPatch!]!) {
79
+ importKpiStatistics(kpiStatistics: $kpiStatistics)
80
+ }
81
+ `,
82
+ variables: { kpiStatistics: this.kpiStatistics }
83
+ })
84
+
85
+ if (response.errors?.length) return
86
+
87
+ this.dispatchEvent(new CustomEvent('imported'))
88
+ }
89
+ }
90
+
@@ -0,0 +1,505 @@
1
+ import '@material/web/icon/icon.js'
2
+ import '@material/web/button/elevated-button.js'
3
+ import '@operato/data-grist/ox-grist.js'
4
+ import '@operato/data-grist/ox-filters-form.js'
5
+ import '@operato/data-grist/ox-record-creator.js'
6
+
7
+ import { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
8
+ import { PageView, store } from '@operato/shell'
9
+ import { css, html } from 'lit'
10
+ import { customElement, property, query } from 'lit/decorators.js'
11
+ import { ScopedElementsMixin } from '@open-wc/scoped-elements'
12
+ import { ColumnConfig, DataGrist, FetchOption } from '@operato/data-grist'
13
+ import { client } from '@operato/graphql'
14
+ import { i18next, localize } from '@operato/i18n'
15
+ import { notify, openPopup } from '@operato/layout'
16
+ import { OxPopup, OxPrompt } from '@operato/popup'
17
+ import { isMobileDevice } from '@operato/utils'
18
+
19
+ import { connect } from 'pwa-helpers/connect-mixin'
20
+ import gql from 'graphql-tag'
21
+
22
+ import { KpiStatisticImporter } from './kpi-statistic-importer.js'
23
+
24
+ @customElement('kpi-statistic-list-page')
25
+ export class KpiStatisticListPage extends connect(store)(localize(i18next)(ScopedElementsMixin(PageView))) {
26
+ static styles = [
27
+ ScrollbarStyles,
28
+ CommonGristStyles,
29
+ CommonHeaderStyles,
30
+ css`
31
+ :host {
32
+ display: flex;
33
+
34
+ width: 100%;
35
+
36
+ --grid-record-emphasized-background-color: #8b0000;
37
+ --grid-record-emphasized-color: #ff6b6b;
38
+ }
39
+
40
+ ox-grist {
41
+ overflow-y: auto;
42
+ flex: 1;
43
+ }
44
+
45
+ ox-filters-form {
46
+ flex: 1;
47
+ }
48
+ `
49
+ ]
50
+
51
+ static get scopedElements() {
52
+ return {
53
+ 'kpi-statistic-importer': KpiStatisticImporter
54
+ }
55
+ }
56
+
57
+ @property({ type: Object }) gristConfig: any
58
+ @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
59
+
60
+ @query('ox-grist') private grist!: DataGrist
61
+
62
+ get context() {
63
+ return {
64
+ title: i18next.t('title.kpi-statistic list'),
65
+ search: {
66
+ handler: (search: string) => {
67
+ this.grist.searchText = search
68
+ },
69
+ value: this.grist.searchText
70
+ },
71
+ filter: {
72
+ handler: () => {
73
+ this.grist.toggleHeadroom()
74
+ }
75
+ },
76
+ help: 'kpi/kpi-statistic',
77
+ actions: [
78
+ {
79
+ title: i18next.t('button.save'),
80
+ action: this._updateKpiStatistic.bind(this),
81
+ ...CommonButtonStyles.save
82
+ },
83
+ {
84
+ title: i18next.t('button.delete'),
85
+ action: this._deleteKpiStatistic.bind(this),
86
+ ...CommonButtonStyles.delete
87
+ }
88
+ ],
89
+ exportable: {
90
+ name: i18next.t('title.kpi-statistic list'),
91
+ data: this.exportHandler.bind(this)
92
+ },
93
+ importable: {
94
+ handler: this.importHandler.bind(this)
95
+ }
96
+ }
97
+ }
98
+
99
+ render() {
100
+ const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')
101
+
102
+ return html`
103
+ <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
104
+ <div slot="headroom" class="header">
105
+ <div class="filters">
106
+ <ox-filters-form autofocus without-search></ox-filters-form>
107
+
108
+ <div id="modes">
109
+ <md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
110
+ <md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
111
+ <md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
112
+ </div>
113
+
114
+ <ox-record-creator id="add" .callback=${this.creationCallback.bind(this)}>
115
+ <button>
116
+ <md-icon>add</md-icon>
117
+ </button>
118
+ </ox-record-creator>
119
+ </div>
120
+ </div>
121
+ </ox-grist>
122
+ `
123
+ }
124
+
125
+ async pageInitialized(lifecycle: any) {
126
+ this.gristConfig = {
127
+ list: {
128
+ fields: ['kpi', 'valueDate', 'periodType'],
129
+ details: ['mean', 'median', 'count', 'updatedAt']
130
+ },
131
+ columns: [
132
+ { type: 'gutter', gutterName: 'sequence' },
133
+ { type: 'gutter', gutterName: 'row-selector', multiple: true },
134
+ {
135
+ type: 'resource-object',
136
+ name: 'kpi',
137
+ header: i18next.t('field.kpi'),
138
+ record: {
139
+ editable: false
140
+ },
141
+ filter: 'search',
142
+ sortable: true,
143
+ width: 150
144
+ },
145
+ {
146
+ type: 'string',
147
+ name: 'valueDate',
148
+ header: i18next.t('field.value_date'),
149
+ record: {
150
+ editable: true
151
+ },
152
+ filter: true,
153
+ sortable: true,
154
+ width: 120
155
+ },
156
+ {
157
+ type: 'string',
158
+ name: 'periodType',
159
+ header: i18next.t('field.period_type'),
160
+ record: {
161
+ editable: true
162
+ },
163
+ filter: true,
164
+ sortable: true,
165
+ width: 100
166
+ },
167
+ {
168
+ type: 'number',
169
+ name: 'count',
170
+ header: i18next.t('field.count'),
171
+ record: {
172
+ editable: false
173
+ },
174
+ sortable: true,
175
+ width: 80
176
+ },
177
+ {
178
+ type: 'number',
179
+ name: 'mean',
180
+ header: i18next.t('field.mean'),
181
+ record: {
182
+ editable: false
183
+ },
184
+ sortable: true,
185
+ width: 100
186
+ },
187
+ {
188
+ type: 'number',
189
+ name: 'median',
190
+ header: i18next.t('field.median'),
191
+ record: {
192
+ editable: false
193
+ },
194
+ sortable: true,
195
+ width: 100
196
+ },
197
+ {
198
+ type: 'number',
199
+ name: 'minimum',
200
+ header: i18next.t('field.minimum'),
201
+ record: {
202
+ editable: false
203
+ },
204
+ sortable: true,
205
+ width: 100
206
+ },
207
+ {
208
+ type: 'number',
209
+ name: 'maximum',
210
+ header: i18next.t('field.maximum'),
211
+ record: {
212
+ editable: false
213
+ },
214
+ sortable: true,
215
+ width: 100
216
+ },
217
+ {
218
+ type: 'number',
219
+ name: 'standardDeviation',
220
+ header: i18next.t('field.standard_deviation'),
221
+ record: {
222
+ editable: false
223
+ },
224
+ sortable: true,
225
+ width: 120
226
+ },
227
+ {
228
+ type: 'number',
229
+ name: 'lowerFence',
230
+ header: i18next.t('field.lower_fence'),
231
+ record: {
232
+ editable: false
233
+ },
234
+ sortable: true,
235
+ width: 100
236
+ },
237
+ {
238
+ type: 'number',
239
+ name: 'upperFence',
240
+ header: i18next.t('field.upper_fence'),
241
+ record: {
242
+ editable: false
243
+ },
244
+ sortable: true,
245
+ width: 100
246
+ },
247
+ {
248
+ type: 'resource-object',
249
+ name: 'updater',
250
+ header: i18next.t('field.updater'),
251
+ record: {
252
+ editable: false
253
+ },
254
+ sortable: true,
255
+ width: 120
256
+ },
257
+ {
258
+ type: 'datetime',
259
+ name: 'updatedAt',
260
+ header: i18next.t('field.updated_at'),
261
+ record: {
262
+ editable: false
263
+ },
264
+ sortable: true,
265
+ width: 180
266
+ }
267
+ ],
268
+ rows: {
269
+ appendable: false,
270
+ selectable: {
271
+ multiple: true
272
+ }
273
+ },
274
+ sorters: [
275
+ {
276
+ name: 'kpi'
277
+ }
278
+ ]
279
+ }
280
+ }
281
+
282
+ async pageUpdated(changes: any, lifecycle: any) {
283
+ if (this.active) {
284
+ // do something here when this page just became as active
285
+ }
286
+ }
287
+
288
+ async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {
289
+ const response = await client.query({
290
+ query: gql`
291
+ query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
292
+ responses: kpiStatistics(filters: $filters, pagination: $pagination, sortings: $sortings) {
293
+ items {
294
+ id
295
+ kpi {
296
+ id
297
+ name
298
+ }
299
+ valueDate
300
+ periodType
301
+ count
302
+ sum
303
+ range
304
+ mean
305
+ median
306
+ minimum
307
+ maximum
308
+ standardDeviation
309
+ variance
310
+ percentile25
311
+ percentile75
312
+ iqr
313
+ lowerFence
314
+ upperFence
315
+ additionalStatistics
316
+ metadata
317
+ updater {
318
+ id
319
+ name
320
+ }
321
+ updatedAt
322
+ }
323
+ total
324
+ }
325
+ }
326
+ `,
327
+ variables: {
328
+ filters,
329
+ pagination: { page, limit },
330
+ sortings
331
+ }
332
+ })
333
+
334
+ return {
335
+ total: response.data.responses.total || 0,
336
+ records: response.data.responses.items || []
337
+ }
338
+ }
339
+
340
+ async _deleteKpiStatistic() {
341
+ if (
342
+ await OxPrompt.open({
343
+ title: i18next.t('text.are_you_sure'),
344
+ text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),
345
+ confirmButton: { text: i18next.t('button.confirm') },
346
+ cancelButton: { text: i18next.t('button.cancel') }
347
+ })
348
+ ) {
349
+ const ids = this.grist.selected.map(record => record.id)
350
+ if (ids && ids.length > 0) {
351
+ const response = await client.mutate({
352
+ mutation: gql`
353
+ mutation ($ids: [String!]!) {
354
+ deleteKpiStatistics(ids: $ids)
355
+ }
356
+ `,
357
+ variables: {
358
+ ids
359
+ }
360
+ })
361
+
362
+ if (!response.errors) {
363
+ this.grist.fetch()
364
+ notify({
365
+ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
366
+ })
367
+ }
368
+ }
369
+ }
370
+ }
371
+
372
+ async _updateKpiStatistic() {
373
+ let patches = this.grist.dirtyRecords
374
+ if (patches && patches.length) {
375
+ patches = patches.map(patch => {
376
+ let patchField: any = patch.id ? { id: patch.id } : {}
377
+ const dirtyFields = patch.__dirtyfields__
378
+ for (let key in dirtyFields) {
379
+ patchField[key] = dirtyFields[key].after
380
+ }
381
+ patchField.cuFlag = patch.__dirty__
382
+
383
+ return patchField
384
+ })
385
+
386
+ const response = await client.mutate({
387
+ mutation: gql`
388
+ mutation ($patches: [KpiStatisticPatch!]!) {
389
+ updateMultipleKpiStatistic(patches: $patches) {
390
+ kpi {
391
+ id
392
+ name
393
+ }
394
+ valueDate
395
+ periodType
396
+ }
397
+ }
398
+ `,
399
+ variables: {
400
+ patches
401
+ }
402
+ })
403
+
404
+ if (!response.errors) {
405
+ this.grist.fetch()
406
+ }
407
+ }
408
+ }
409
+
410
+ async creationCallback(kpiStatistic) {
411
+ try {
412
+ const response = await client.query({
413
+ query: gql`
414
+ mutation ($kpiStatistic: NewKpiStatistic!) {
415
+ createKpiStatistic(kpiStatistic: $kpiStatistic) {
416
+ id
417
+ }
418
+ }
419
+ `,
420
+ variables: {
421
+ kpiStatistic
422
+ },
423
+ context: {
424
+ hasUpload: true
425
+ }
426
+ })
427
+
428
+ if (!response.errors) {
429
+ this.grist.fetch()
430
+ document.dispatchEvent(
431
+ new CustomEvent('notify', {
432
+ detail: {
433
+ message: i18next.t('text.data_created_successfully')
434
+ }
435
+ })
436
+ )
437
+ }
438
+
439
+ return true
440
+ } catch (ex) {
441
+ console.error(ex)
442
+ document.dispatchEvent(
443
+ new CustomEvent('notify', {
444
+ detail: {
445
+ type: 'error',
446
+ message: i18next.t('text.error')
447
+ }
448
+ })
449
+ )
450
+ return false
451
+ }
452
+ }
453
+
454
+ async exportHandler() {
455
+ const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records
456
+ const targetFieldSet = new Set([
457
+ 'id',
458
+ 'kpi',
459
+ 'kpiType',
460
+ 'period',
461
+ 'startDate',
462
+ 'endDate',
463
+ 'count',
464
+ 'mean',
465
+ 'median',
466
+ 'minimum',
467
+ 'maximum',
468
+ 'standardDeviation',
469
+ 'lowerFence',
470
+ 'upperFence'
471
+ ])
472
+
473
+ return exportTargets.map(kpiStatistic => {
474
+ let tempObj = {}
475
+ for (const field of targetFieldSet) {
476
+ tempObj[field] = kpiStatistic[field]
477
+ }
478
+
479
+ return tempObj
480
+ })
481
+ }
482
+
483
+ async importHandler(records) {
484
+ const popup = openPopup(
485
+ html`
486
+ <kpi-statistic-importer
487
+ .kpiStatistics=${records}
488
+ @imported=${() => {
489
+ history.back()
490
+ this.grist.fetch()
491
+ }}
492
+ ></kpi-statistic-importer>
493
+ `,
494
+ {
495
+ backdrop: true,
496
+ size: 'large',
497
+ title: i18next.t('title.import kpi-statistic')
498
+ }
499
+ )
500
+
501
+ popup.onclosed = () => {
502
+ this.grist.fetch()
503
+ }
504
+ }
505
+ }
package/client/route.ts CHANGED
@@ -51,5 +51,13 @@ export default function route(page: string) {
51
51
  case 'kpi-history-list':
52
52
  import('./pages/kpi-history/kpi-history-list-page')
53
53
  return page
54
+
55
+ case 'kpi-statistic-list':
56
+ import('./pages/kpi-statistic/kpi-statistic-list-page')
57
+ return page
58
+
59
+ case 'kpi-statistic-editor':
60
+ import('./pages/kpi-statistic/kpi-statistic-editor-page')
61
+ return page
54
62
  }
55
63
  }
@@ -0,0 +1,53 @@
1
+ import '@material/web/icon/icon.js';
2
+ import '@material/web/button/elevated-button.js';
3
+ import '@material/web/textfield/outlined-text-field.js';
4
+ import { PageView } from '@operato/shell';
5
+ declare const KpiStatisticEditorPage_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
+ }) & (new (...args: any[]) => import("lit").LitElement) & typeof PageView & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
12
+ export declare class KpiStatisticEditorPage extends KpiStatisticEditorPage_base {
13
+ static styles: import("lit").CSSResult[];
14
+ periodType: string;
15
+ valueDate: string;
16
+ targetDate: string;
17
+ private kpis;
18
+ private loading;
19
+ private error;
20
+ private editingCell;
21
+ private _existingStatistics;
22
+ private readonly statisticFields;
23
+ get context(): {
24
+ title: string;
25
+ actions: {
26
+ icon: string;
27
+ emphasis: {
28
+ raised: boolean;
29
+ outlined: boolean;
30
+ dense: boolean;
31
+ danger: boolean;
32
+ };
33
+ title: string;
34
+ action: () => void;
35
+ }[];
36
+ };
37
+ render(): import("lit-html").TemplateResult<1>;
38
+ private _getCellClass;
39
+ private _isFieldEditable;
40
+ private _isFieldHighlighted;
41
+ private _renderCellContent;
42
+ private _startEdit;
43
+ private _finishEdit;
44
+ private _loadData;
45
+ private _saveStatistics;
46
+ private _findExistingStatistic;
47
+ private _onTargetDateChange;
48
+ private _onPeriodChange;
49
+ private _calculateDateRange;
50
+ private _cancel;
51
+ pageInitialized(lifecycle: any): Promise<void>;
52
+ }
53
+ export {};