@things-factory/operato-board 6.0.0-alpha.7 → 6.0.0-alpha.9
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/client/route.js
CHANGED
|
@@ -42,13 +42,5 @@ export default function route(page) {
|
|
|
42
42
|
case 'scenario-list':
|
|
43
43
|
import('./pages/scenario-list-page')
|
|
44
44
|
return page
|
|
45
|
-
|
|
46
|
-
case 'headroom-test':
|
|
47
|
-
import('./pages/headroom-test-page')
|
|
48
|
-
return page
|
|
49
|
-
|
|
50
|
-
case 'sticky-test':
|
|
51
|
-
import('./pages/sticky-test-page')
|
|
52
|
-
return page
|
|
53
45
|
}
|
|
54
46
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
2
|
+
"Product": "Operato Board",
|
|
3
|
+
"License Type": "Evaluation",
|
|
4
|
+
"Purchase Date": "2022.10.18",
|
|
5
|
+
"Expiration Date": "2023.01.18",
|
|
6
|
+
"Host Address": "UNLIMITED",
|
|
7
|
+
"Max Target Count": 0,
|
|
8
|
+
"Max Domain Count": 0,
|
|
9
|
+
"Permissions For Board Usage": "Viewer",
|
|
10
|
+
"Permissions For Tailor Tool": "",
|
|
11
|
+
"Key": "5eyJQcm9kdWN0IjoiT3BlcmF0byBCb2FyZCIsIkxpY2Vuc2UgVHlwZSI6IkV2YWx1YXRpb24iLCJQdXJjaGFzZSBEYXRlIjoiMjAyMi4xMC4xOCIsIkV4cGlyYXRpb24gRGF0ZSI6IjIwMjMuMDEuMTgiLCJIb3N0IEFkZHJlc3MiOiJVTkxJTUlURUQiLCJNYXggVGFyZ2V0IENvdW50IjowLCJNYXggRG9tYWluIENvdW50IjowLCJQZXJtaXNzaW9ucyBGb3IgQm9hcmQgVXNhZ2UiOiJWaWV3ZXIiLCJQZXJtaXNzaW9ucyBGb3IgVGFpbG9yIFRvb2wiOiIiLCJLZXkiOiJBeGdxR0F4Tk13b0NLUm94S3dFQVNSZ3VJRDRGREM0NURWa3FIZ0FFSWhnYUppWlRJd29XUWc4dkhnd01FaGNHREJvRUZob1dKaFlqQ2d3RUR3b0VPQlk0R2c4QUJEUUlLQ1lsTVFnSkdEd0hHaTRSRlRNcUhBa3FGZ3NyQVFCSkh3a2hTeHNJUUE4aUl6Z1hFeFVmRWlzQ0dSUUpHZ3BMRHdraUJ3MFNPQVlRR1NJeEdoWW1GaU1KR1VrYkNTY01JaVFuRkJVbUFRZ29KaVVwQ2k0VUFoOGNMZ0lWS0NJTEFRVWJDQ1VBSlRZWUNoWWNGQXdJRkIwMUd3Z1dGUjRUR3hFSVJ4WWFIRXNPTHg0NUppVWVGUUlwTXpFckFRQlhJQjRZSUE4SkRRSWRKek1UQ1NrRUZDc2tJVllJQ2kwQ0h3a0ZEaU1qSWhBSUtoNFRFeEVoV2dzS0tVY0ZHRElpRFJNakJoRS9Md2NSQkI1SEZna1VPZzR2SHdBZ1NTSUtBU2tTTGhvUkpra2dIaGdqRGdrcUN3NDRIaGtCS1M4VUVSQXRKd291R1RrU0dpNEhEU2N6R0JrWUZoVVNOd2hKSFFnWk93SVFOeXc9In0=81098"
|
|
12
|
+
}
|
package/config/license.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
+
"Product": "Operato Board",
|
|
2
3
|
"License Type": "Evaluation",
|
|
3
|
-
"Purchase Date": "2022.
|
|
4
|
-
"Expiration Date": "
|
|
4
|
+
"Purchase Date": "2022.10.18",
|
|
5
|
+
"Expiration Date": "2023.01.18",
|
|
5
6
|
"Host Address": "UNLIMITED",
|
|
6
7
|
"Max Target Count": 0,
|
|
7
8
|
"Max Domain Count": 0,
|
|
8
9
|
"Permissions For Board Usage": "Viewer, Modeller",
|
|
9
|
-
"
|
|
10
|
-
|
|
10
|
+
"Permissions For Tailor Tool": "",
|
|
11
|
+
"Key": "5eyJQcm9kdWN0IjoiT3BlcmF0byBCb2FyZCIsIkxpY2Vuc2UgVHlwZSI6IkV2YWx1YXRpb24iLCJQdXJjaGFzZSBEYXRlIjoiMjAyMi4xMC4xOCIsIkV4cGlyYXRpb24gRGF0ZSI6IjIwMjMuMDEuMTgiLCJIb3N0IEFkZHJlc3MiOiJVTkxJTUlURUQiLCJNYXggVGFyZ2V0IENvdW50IjowLCJNYXggRG9tYWluIENvdW50IjowLCJQZXJtaXNzaW9ucyBGb3IgQm9hcmQgVXNhZ2UiOiJWaWV3ZXIsIE1vZGVsbGVyIiwiUGVybWlzc2lvbnMgRm9yIFRhaWxvciBUb29sIjoiIiwiS2V5IjoiQXhncUdBeE5Nd29DS1JveEt3RUFTUmd1SUQ0RkRDNDVEVmtxSGdBRUloZ2FKaVpUSXdvV1FnOHZIZ3dNRWhjR0RCb0VGaG9XSmhZakNnd0VEd29FT0JZNEdnOEFCRFFJS0NZbE1RZ0pHRHdIR2k0UkZUTXFIQWtxRmdzckFRQkpId2toU3hzSVFBOGlJemdYRXhVZkVpc0NHUlFKR2dwTER3a2lCdzBTT0FZUUdTSXhHaFltRmlNSkdVa2JDU2NNSWlRbkZCVW1BUWdvSmlVcENpNFVBaDhjTGdJVktDSUxBUVViQ0NVQUpUWVlDaFljRkF3SUZCMDFHd2dXRlI0VEd4RUlSeFlhSEVzT0x4NDVKaVVlRlFJcE16RXJBUUJYSUI0WUlBOEpEUUlkSnpNVENTa0VGQ3NrSVZZSUNpMENId2tGRGlNakloQUlLaDRURXhFaFdnc0tLVWNGR0RJaURSTWpCaEUvTHdjUkJCNUhGZ2tVT2c0dkh3QWdTU0lLQVNrU0xob1JKbE1qSERGSURob2VDZzBuRmhnWk93OElIeUlaV1FvS0Nrd0ZMd2dORFU0ZkJoQS9MeGdySXgxSUN3b1dTQVVJTWhRTkVqTVNHVHdIQ0NzRlB4MD0ifQ==85748"
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/operato-board",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.9",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -78,38 +78,38 @@
|
|
|
78
78
|
"@operato/shell": "^1.0.1",
|
|
79
79
|
"@operato/styles": "^1.0.0",
|
|
80
80
|
"@operato/utils": "^1.0.1",
|
|
81
|
-
"@things-factory/apptool-ui": "^6.0.0-alpha.
|
|
82
|
-
"@things-factory/auth-ui": "^6.0.0-alpha.
|
|
83
|
-
"@things-factory/board-service": "^6.0.0-alpha.
|
|
84
|
-
"@things-factory/board-ui": "^6.0.0-alpha.
|
|
85
|
-
"@things-factory/context-ui": "^6.0.0-alpha.
|
|
86
|
-
"@things-factory/export-ui": "^6.0.0-alpha.
|
|
87
|
-
"@things-factory/fav-base": "^6.0.0-alpha.
|
|
88
|
-
"@things-factory/font-base": "^6.0.0-alpha.
|
|
89
|
-
"@things-factory/form-ui": "^6.0.0-alpha.
|
|
90
|
-
"@things-factory/help": "^6.0.0-alpha.
|
|
91
|
-
"@things-factory/i18n-base": "^6.0.0-alpha.
|
|
92
|
-
"@things-factory/import-ui": "^6.0.0-alpha.
|
|
93
|
-
"@things-factory/integration-notification": "^6.0.0-alpha.
|
|
94
|
-
"@things-factory/integration-ui": "^6.0.0-alpha.
|
|
95
|
-
"@things-factory/layout-ui": "^6.0.0-alpha.
|
|
96
|
-
"@things-factory/more-ui": "^6.0.0-alpha.
|
|
97
|
-
"@things-factory/notification": "^6.0.0-alpha.
|
|
98
|
-
"@things-factory/oauth2-client": "^6.0.0-alpha.
|
|
99
|
-
"@things-factory/offline-ui": "^6.0.0-alpha.
|
|
81
|
+
"@things-factory/apptool-ui": "^6.0.0-alpha.8",
|
|
82
|
+
"@things-factory/auth-ui": "^6.0.0-alpha.8",
|
|
83
|
+
"@things-factory/board-service": "^6.0.0-alpha.9",
|
|
84
|
+
"@things-factory/board-ui": "^6.0.0-alpha.9",
|
|
85
|
+
"@things-factory/context-ui": "^6.0.0-alpha.8",
|
|
86
|
+
"@things-factory/export-ui": "^6.0.0-alpha.8",
|
|
87
|
+
"@things-factory/fav-base": "^6.0.0-alpha.8",
|
|
88
|
+
"@things-factory/font-base": "^6.0.0-alpha.8",
|
|
89
|
+
"@things-factory/form-ui": "^6.0.0-alpha.8",
|
|
90
|
+
"@things-factory/help": "^6.0.0-alpha.8",
|
|
91
|
+
"@things-factory/i18n-base": "^6.0.0-alpha.8",
|
|
92
|
+
"@things-factory/import-ui": "^6.0.0-alpha.8",
|
|
93
|
+
"@things-factory/integration-notification": "^6.0.0-alpha.8",
|
|
94
|
+
"@things-factory/integration-ui": "^6.0.0-alpha.8",
|
|
95
|
+
"@things-factory/layout-ui": "^6.0.0-alpha.8",
|
|
96
|
+
"@things-factory/more-ui": "^6.0.0-alpha.8",
|
|
97
|
+
"@things-factory/notification": "^6.0.0-alpha.8",
|
|
98
|
+
"@things-factory/oauth2-client": "^6.0.0-alpha.8",
|
|
99
|
+
"@things-factory/offline-ui": "^6.0.0-alpha.8",
|
|
100
100
|
"@things-factory/operato-license-checker": "^3.1.0",
|
|
101
|
-
"@things-factory/pdf": "^6.0.0-alpha.
|
|
102
|
-
"@things-factory/print-service": "^6.0.0-alpha.
|
|
103
|
-
"@things-factory/print-ui": "^6.0.0-alpha.
|
|
104
|
-
"@things-factory/resource-ui": "^6.0.0-alpha.
|
|
105
|
-
"@things-factory/scene-google-map": "^6.0.0-alpha.
|
|
106
|
-
"@things-factory/scene-visualizer": "^6.0.0-alpha.
|
|
107
|
-
"@things-factory/setting-ui": "^6.0.0-alpha.
|
|
108
|
-
"@things-factory/system-ui": "^6.0.0-alpha.
|
|
101
|
+
"@things-factory/pdf": "^6.0.0-alpha.8",
|
|
102
|
+
"@things-factory/print-service": "^6.0.0-alpha.8",
|
|
103
|
+
"@things-factory/print-ui": "^6.0.0-alpha.8",
|
|
104
|
+
"@things-factory/resource-ui": "^6.0.0-alpha.8",
|
|
105
|
+
"@things-factory/scene-google-map": "^6.0.0-alpha.8",
|
|
106
|
+
"@things-factory/scene-visualizer": "^6.0.0-alpha.8",
|
|
107
|
+
"@things-factory/setting-ui": "^6.0.0-alpha.8",
|
|
108
|
+
"@things-factory/system-ui": "^6.0.0-alpha.8"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
|
-
"@things-factory/board-test": "^6.0.0-alpha.
|
|
112
|
-
"@things-factory/builder": "^6.0.0-alpha.
|
|
111
|
+
"@things-factory/board-test": "^6.0.0-alpha.9",
|
|
112
|
+
"@things-factory/builder": "^6.0.0-alpha.8"
|
|
113
113
|
},
|
|
114
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "3b34aa7eb3bd773e57a29fb1ff8a258074b10ad5"
|
|
115
115
|
}
|
package/things-factory.config.js
CHANGED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import '@things-factory/grist-ui'
|
|
2
|
-
|
|
3
|
-
import { css, html } from 'lit'
|
|
4
|
-
|
|
5
|
-
import { i18next } from '@things-factory/i18n-base'
|
|
6
|
-
import { PageView } from '@things-factory/shell'
|
|
7
|
-
import { ScrollbarStyles } from '@things-factory/styles'
|
|
8
|
-
import { isMobileDevice } from '@things-factory/utils'
|
|
9
|
-
|
|
10
|
-
export class HeadroomTestPage extends PageView {
|
|
11
|
-
static get properties() {
|
|
12
|
-
return {}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
static get styles() {
|
|
16
|
-
return [
|
|
17
|
-
ScrollbarStyles,
|
|
18
|
-
css`
|
|
19
|
-
:host {
|
|
20
|
-
display: flex;
|
|
21
|
-
position: relative;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
|
|
24
|
-
overflow: hidden;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
#search-form {
|
|
28
|
-
background-color: blue;
|
|
29
|
-
color: white;
|
|
30
|
-
width: 100%;
|
|
31
|
-
height: 100px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
data-grist {
|
|
35
|
-
overflow-y: auto;
|
|
36
|
-
flex: 1;
|
|
37
|
-
}
|
|
38
|
-
`
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
get context() {
|
|
43
|
-
return {
|
|
44
|
-
title: 'headroom test',
|
|
45
|
-
actions: []
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
render() {
|
|
50
|
-
return html`
|
|
51
|
-
<div style="height: 100px; width: 100%; background-color:red;color:white;">Fixed Area</div>
|
|
52
|
-
|
|
53
|
-
<data-grist
|
|
54
|
-
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
55
|
-
.config=${this.gristConfig}
|
|
56
|
-
.fetchHandler=${this.fetchHandler.bind(this)}
|
|
57
|
-
>
|
|
58
|
-
<div slot="headroom" id="search-form">Headroom Area</div>
|
|
59
|
-
</data-grist>
|
|
60
|
-
`
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
get dataGrist() {
|
|
64
|
-
return this.shadowRoot.querySelector('data-grist')
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
async pageInitialized(lifecycle) {
|
|
68
|
-
this.searchConfig = [
|
|
69
|
-
{
|
|
70
|
-
name: 'name',
|
|
71
|
-
type: 'text',
|
|
72
|
-
props: {
|
|
73
|
-
placeholder: i18next.t('field.name'),
|
|
74
|
-
searchOper: 'like'
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
name: 'type',
|
|
79
|
-
type: 'text',
|
|
80
|
-
props: {
|
|
81
|
-
placeholder: i18next.t('field.type'),
|
|
82
|
-
searchOper: 'eq'
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
name: 'description',
|
|
87
|
-
type: 'text',
|
|
88
|
-
props: {
|
|
89
|
-
placeholder: i18next.t('field.description'),
|
|
90
|
-
searchOper: 'like'
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
-
|
|
95
|
-
this._updateSearchConfig(lifecycle)
|
|
96
|
-
|
|
97
|
-
this.gristConfig = {
|
|
98
|
-
list: { fields: ['name', 'description', 'state'] },
|
|
99
|
-
columns: [
|
|
100
|
-
{ type: 'gutter', gutterName: 'sequence' },
|
|
101
|
-
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
102
|
-
{
|
|
103
|
-
type: 'string',
|
|
104
|
-
name: 'name',
|
|
105
|
-
header: i18next.t('field.name'),
|
|
106
|
-
record: {
|
|
107
|
-
editable: true
|
|
108
|
-
},
|
|
109
|
-
sortable: true,
|
|
110
|
-
width: 150
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
type: 'string',
|
|
114
|
-
name: 'description',
|
|
115
|
-
header: i18next.t('field.description'),
|
|
116
|
-
record: {
|
|
117
|
-
editable: true
|
|
118
|
-
},
|
|
119
|
-
width: 200
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
type: 'checkbox',
|
|
123
|
-
name: 'active',
|
|
124
|
-
header: i18next.t('field.active'),
|
|
125
|
-
record: {
|
|
126
|
-
editable: true
|
|
127
|
-
},
|
|
128
|
-
sortable: true,
|
|
129
|
-
width: 60
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
type: 'object',
|
|
133
|
-
name: 'updater',
|
|
134
|
-
header: i18next.t('field.updater'),
|
|
135
|
-
record: {
|
|
136
|
-
editable: false
|
|
137
|
-
},
|
|
138
|
-
sortable: true,
|
|
139
|
-
width: 120
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
type: 'datetime',
|
|
143
|
-
name: 'updatedAt',
|
|
144
|
-
header: i18next.t('field.updated_at'),
|
|
145
|
-
record: {
|
|
146
|
-
editable: false
|
|
147
|
-
},
|
|
148
|
-
sortable: true,
|
|
149
|
-
width: 180
|
|
150
|
-
}
|
|
151
|
-
],
|
|
152
|
-
rows: {
|
|
153
|
-
selectable: {
|
|
154
|
-
multiple: true
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
sorters: [
|
|
158
|
-
{
|
|
159
|
-
name: 'name'
|
|
160
|
-
}
|
|
161
|
-
]
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
await this.updateComplete
|
|
165
|
-
|
|
166
|
-
this.dataGrist.fetch()
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
async pageUpdated(changes, lifecycle) {
|
|
170
|
-
if (this.active) {
|
|
171
|
-
// update with url params value
|
|
172
|
-
this._updateSearchConfig(lifecycle)
|
|
173
|
-
await this.updateComplete
|
|
174
|
-
|
|
175
|
-
this.dataGrist.fetch()
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
async fetchHandler({ page, limit, sorters = [] }) {
|
|
180
|
-
return {
|
|
181
|
-
total: 30,
|
|
182
|
-
records: new Array(30).fill('').map((_, idx) => {
|
|
183
|
-
return {
|
|
184
|
-
name: idx,
|
|
185
|
-
description: idx,
|
|
186
|
-
active: true
|
|
187
|
-
}
|
|
188
|
-
})
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
async stateChanged(state) {}
|
|
193
|
-
|
|
194
|
-
// update with url params value
|
|
195
|
-
_updateSearchConfig(lifecycle) {
|
|
196
|
-
this.searchConfig = this.searchConfig.map(conf => {
|
|
197
|
-
if (conf.name in lifecycle.params) {
|
|
198
|
-
conf.value = lifecycle.params[conf.name]
|
|
199
|
-
} else {
|
|
200
|
-
delete conf.value
|
|
201
|
-
}
|
|
202
|
-
return conf
|
|
203
|
-
})
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
window.customElements.define('headroom-test-page', HeadroomTestPage)
|
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import '@things-factory/grist-ui'
|
|
2
|
-
|
|
3
|
-
import { css, html } from 'lit'
|
|
4
|
-
|
|
5
|
-
import { i18next } from '@things-factory/i18n-base'
|
|
6
|
-
import { PageView } from '@things-factory/shell'
|
|
7
|
-
import { ScrollbarStyles } from '@things-factory/styles'
|
|
8
|
-
import { isMobileDevice } from '@things-factory/utils'
|
|
9
|
-
|
|
10
|
-
export class StickyTestPage extends PageView {
|
|
11
|
-
static get properties() {
|
|
12
|
-
return {}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
static get styles() {
|
|
16
|
-
return [
|
|
17
|
-
ScrollbarStyles,
|
|
18
|
-
css`
|
|
19
|
-
:host {
|
|
20
|
-
display: block;
|
|
21
|
-
position: relative;
|
|
22
|
-
|
|
23
|
-
overflow: auto;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/* The sticky class is added to the header with JS when it reaches its scroll position */
|
|
27
|
-
.sticky {
|
|
28
|
-
position: absolute;
|
|
29
|
-
width: 100%;
|
|
30
|
-
|
|
31
|
-
z-index: 1;
|
|
32
|
-
}
|
|
33
|
-
`
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
get context() {
|
|
38
|
-
return {
|
|
39
|
-
title: 'sticky test',
|
|
40
|
-
actions: []
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
render() {
|
|
45
|
-
return html`
|
|
46
|
-
<div>
|
|
47
|
-
<div style="height: 200px; width: 100%; background-color:blue;color:white;">Scroll Area</div>
|
|
48
|
-
</div>
|
|
49
|
-
|
|
50
|
-
<div id="header" style="height: 100px; width: 100%; background-color:red;color:white;">Fixed Area</div>
|
|
51
|
-
|
|
52
|
-
<data-grist
|
|
53
|
-
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
54
|
-
.config=${this.gristConfig}
|
|
55
|
-
.fetchHandler=${this.fetchHandler.bind(this)}
|
|
56
|
-
>
|
|
57
|
-
</data-grist>
|
|
58
|
-
`
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
get dataGrist() {
|
|
62
|
-
return this.shadowRoot.querySelector('data-grist')
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
async firstUpdated() {
|
|
66
|
-
// Get the header
|
|
67
|
-
var header = this.renderRoot.querySelector('#header')
|
|
68
|
-
var grist = this.renderRoot.querySelector('data-grist')
|
|
69
|
-
|
|
70
|
-
var stickyTop = header.offsetTop
|
|
71
|
-
var stickyHeight = header.offsetHeight
|
|
72
|
-
|
|
73
|
-
this.addEventListener('scroll', e => {
|
|
74
|
-
if (this.scrollTop > stickyTop) {
|
|
75
|
-
header.classList.add('sticky')
|
|
76
|
-
grist.style.paddingTop = stickyHeight + 'px'
|
|
77
|
-
header.style.top = this.scrollTop + 'px'
|
|
78
|
-
} else {
|
|
79
|
-
header.classList.remove('sticky')
|
|
80
|
-
grist.style.paddingTop = 0
|
|
81
|
-
}
|
|
82
|
-
})
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
async pageInitialized(lifecycle) {
|
|
86
|
-
this.searchConfig = [
|
|
87
|
-
{
|
|
88
|
-
name: 'name',
|
|
89
|
-
type: 'text',
|
|
90
|
-
props: {
|
|
91
|
-
placeholder: i18next.t('field.name'),
|
|
92
|
-
searchOper: 'like'
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
name: 'type',
|
|
97
|
-
type: 'text',
|
|
98
|
-
props: {
|
|
99
|
-
placeholder: i18next.t('field.type'),
|
|
100
|
-
searchOper: 'eq'
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
name: 'description',
|
|
105
|
-
type: 'text',
|
|
106
|
-
props: {
|
|
107
|
-
placeholder: i18next.t('field.description'),
|
|
108
|
-
searchOper: 'like'
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
]
|
|
112
|
-
|
|
113
|
-
this._updateSearchConfig(lifecycle)
|
|
114
|
-
|
|
115
|
-
this.gristConfig = {
|
|
116
|
-
list: { fields: ['name', 'description', 'state'] },
|
|
117
|
-
columns: [
|
|
118
|
-
{ type: 'gutter', gutterName: 'sequence' },
|
|
119
|
-
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
120
|
-
{
|
|
121
|
-
type: 'string',
|
|
122
|
-
name: 'name',
|
|
123
|
-
header: i18next.t('field.name'),
|
|
124
|
-
record: {
|
|
125
|
-
editable: true
|
|
126
|
-
},
|
|
127
|
-
sortable: true,
|
|
128
|
-
width: 150
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
type: 'string',
|
|
132
|
-
name: 'description',
|
|
133
|
-
header: i18next.t('field.description'),
|
|
134
|
-
record: {
|
|
135
|
-
editable: true
|
|
136
|
-
},
|
|
137
|
-
width: 200
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
type: 'checkbox',
|
|
141
|
-
name: 'active',
|
|
142
|
-
header: i18next.t('field.active'),
|
|
143
|
-
record: {
|
|
144
|
-
editable: true
|
|
145
|
-
},
|
|
146
|
-
sortable: true,
|
|
147
|
-
width: 60
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
type: 'object',
|
|
151
|
-
name: 'updater',
|
|
152
|
-
header: i18next.t('field.updater'),
|
|
153
|
-
record: {
|
|
154
|
-
editable: false
|
|
155
|
-
},
|
|
156
|
-
sortable: true,
|
|
157
|
-
width: 120
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
type: 'datetime',
|
|
161
|
-
name: 'updatedAt',
|
|
162
|
-
header: i18next.t('field.updated_at'),
|
|
163
|
-
record: {
|
|
164
|
-
editable: false
|
|
165
|
-
},
|
|
166
|
-
sortable: true,
|
|
167
|
-
width: 180
|
|
168
|
-
}
|
|
169
|
-
],
|
|
170
|
-
rows: {
|
|
171
|
-
selectable: {
|
|
172
|
-
multiple: true
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
sorters: [
|
|
176
|
-
{
|
|
177
|
-
name: 'name'
|
|
178
|
-
}
|
|
179
|
-
]
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
await this.updateComplete
|
|
183
|
-
|
|
184
|
-
this.dataGrist.fetch()
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
async pageUpdated(changes, lifecycle) {
|
|
188
|
-
if (this.active) {
|
|
189
|
-
// update with url params value
|
|
190
|
-
this._updateSearchConfig(lifecycle)
|
|
191
|
-
await this.updateComplete
|
|
192
|
-
|
|
193
|
-
this.dataGrist.fetch()
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
async fetchHandler({ page, limit, sorters = [] }) {
|
|
198
|
-
return {
|
|
199
|
-
total: 30,
|
|
200
|
-
records: new Array(30).fill('').map((_, idx) => {
|
|
201
|
-
return {
|
|
202
|
-
name: idx,
|
|
203
|
-
description: idx,
|
|
204
|
-
active: true
|
|
205
|
-
}
|
|
206
|
-
})
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
async stateChanged(state) {}
|
|
211
|
-
|
|
212
|
-
// update with url params value
|
|
213
|
-
_updateSearchConfig(lifecycle) {
|
|
214
|
-
this.searchConfig = this.searchConfig.map(conf => {
|
|
215
|
-
if (conf.name in lifecycle.params) {
|
|
216
|
-
conf.value = lifecycle.params[conf.name]
|
|
217
|
-
} else {
|
|
218
|
-
delete conf.value
|
|
219
|
-
}
|
|
220
|
-
return conf
|
|
221
|
-
})
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
window.customElements.define('sticky-test-page', StickyTestPage)
|