@operato/dataset 1.0.0-beta.8 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +378 -0
- package/dist/src/grist-editor/ox-grist-editor-data-item-spec.js +1 -1
- package/dist/src/grist-editor/ox-grist-editor-data-item-spec.js.map +1 -1
- package/dist/src/grist-editor/ox-popup-data-item-spec.js +3 -2
- package/dist/src/grist-editor/ox-popup-data-item-spec.js.map +1 -1
- package/dist/src/index.d.ts +1 -5
- package/dist/src/index.js +1 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/ox-data-entry-form.js +24 -4
- package/dist/src/ox-data-entry-form.js.map +1 -1
- package/dist/src/ox-data-item-spec.d.ts +2 -2
- package/dist/src/ox-data-item-spec.js +71 -14
- package/dist/src/ox-data-item-spec.js.map +1 -1
- package/dist/src/ox-data-ooc-view.js +73 -14
- package/dist/src/ox-data-ooc-view.js.map +1 -1
- package/dist/src/ox-data-sample-view.d.ts +1 -3
- package/dist/src/ox-data-sample-view.js +40 -38
- package/dist/src/ox-data-sample-view.js.map +1 -1
- package/dist/src/types.d.ts +25 -6
- package/dist/src/types.js.map +1 -1
- package/dist/src/usecase/ccp/index.d.ts +1 -0
- package/dist/src/usecase/ccp/index.js +8 -0
- package/dist/src/usecase/ccp/index.js.map +1 -0
- package/dist/src/usecase/ccp/ox-data-use-case-ccp.d.ts +7 -0
- package/dist/src/usecase/ccp/ox-data-use-case-ccp.js +102 -0
- package/dist/src/usecase/ccp/ox-data-use-case-ccp.js.map +1 -0
- package/dist/src/usecase/ccp/ox-input-ccp-limits.d.ts +44 -0
- package/dist/src/usecase/ccp/ox-input-ccp-limits.js +171 -0
- package/dist/src/usecase/ccp/ox-input-ccp-limits.js.map +1 -0
- package/dist/src/usecase/ccp/ox-property-editor-ccp-limits.d.ts +5 -0
- package/dist/src/usecase/ccp/ox-property-editor-ccp-limits.js +24 -0
- package/dist/src/usecase/ccp/ox-property-editor-ccp-limits.js.map +1 -0
- package/dist/src/{ox-data-use-case.d.ts → usecase/ox-data-use-case.d.ts} +5 -5
- package/dist/src/{ox-data-use-case.js → usecase/ox-data-use-case.js} +22 -34
- package/dist/src/usecase/ox-data-use-case.js.map +1 -0
- package/dist/src/usecase/qc/index.d.ts +1 -0
- package/dist/src/usecase/qc/index.js +8 -0
- package/dist/src/usecase/qc/index.js.map +1 -0
- package/dist/src/usecase/qc/ox-data-use-case-qc.d.ts +7 -0
- package/dist/src/usecase/qc/ox-data-use-case-qc.js +55 -0
- package/dist/src/usecase/qc/ox-data-use-case-qc.js.map +1 -0
- package/dist/src/usecase/qc/ox-input-qc-limits.d.ts +44 -0
- package/dist/src/usecase/qc/ox-input-qc-limits.js +171 -0
- package/dist/src/usecase/qc/ox-input-qc-limits.js.map +1 -0
- package/dist/src/usecase/qc/ox-property-editor-qc-limits.d.ts +5 -0
- package/dist/src/usecase/qc/ox-property-editor-qc-limits.js +24 -0
- package/dist/src/usecase/qc/ox-property-editor-qc-limits.js.map +1 -0
- package/dist/stories/ox-data-entry-form.stories.d.ts +19 -0
- package/dist/stories/ox-data-entry-form.stories.js +152 -0
- package/dist/stories/ox-data-entry-form.stories.js.map +1 -0
- package/dist/stories/ox-data-item-spec.stories.d.ts +26 -0
- package/dist/stories/ox-data-item-spec.stories.js +102 -0
- package/dist/stories/ox-data-item-spec.stories.js.map +1 -0
- package/dist/stories/ox-data-ooc-view.stories.d.ts +19 -0
- package/dist/stories/ox-data-ooc-view.stories.js +242 -0
- package/dist/stories/ox-data-ooc-view.stories.js.map +1 -0
- package/dist/stories/ox-data-sample-view.stories.d.ts +19 -0
- package/dist/stories/ox-data-sample-view.stories.js +213 -0
- package/dist/stories/ox-data-sample-view.stories.js.map +1 -0
- package/dist/stories/ox-grist-editor-data-item-spec.stories.d.ts +27 -0
- package/dist/stories/ox-grist-editor-data-item-spec.stories.js +389 -0
- package/dist/stories/ox-grist-editor-data-item-spec.stories.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +24 -18
- package/src/grist-editor/ox-grist-editor-data-item-spec.ts +1 -1
- package/src/grist-editor/ox-popup-data-item-spec.ts +3 -2
- package/src/index.ts +1 -5
- package/src/ox-data-entry-form.ts +24 -4
- package/src/ox-data-item-spec.ts +73 -16
- package/src/ox-data-ooc-view.ts +73 -14
- package/src/ox-data-sample-view.ts +43 -39
- package/src/types.ts +31 -6
- package/src/usecase/ccp/index.ts +10 -0
- package/src/usecase/ccp/ox-data-use-case-ccp.ts +147 -0
- package/src/usecase/ccp/ox-input-ccp-limits.ts +161 -0
- package/src/usecase/ccp/ox-property-editor-ccp-limits.ts +23 -0
- package/src/{ox-data-use-case.ts → usecase/ox-data-use-case.ts} +27 -41
- package/src/usecase/qc/index.ts +10 -0
- package/src/usecase/qc/ox-data-use-case-qc.ts +72 -0
- package/src/usecase/qc/ox-input-qc-limits.ts +161 -0
- package/src/usecase/qc/ox-property-editor-qc-limits.ts +23 -0
- package/stories/ox-data-entry-form.stories.ts +165 -0
- package/stories/ox-data-item-spec.stories.ts +121 -0
- package/stories/ox-data-ooc-view.stories.ts +256 -0
- package/stories/ox-data-sample-view.stories.ts +227 -0
- package/stories/ox-grist-editor-data-item-spec.stories.ts +409 -0
- package/translations/en.json +26 -8
- package/translations/ko.json +25 -7
- package/translations/ms.json +26 -8
- package/translations/zh.json +25 -7
- package/demo/index.html +0 -28
- package/demo/ox-data-entry-form.html +0 -118
- package/demo/ox-data-item-spec.html +0 -152
- package/demo/ox-data-ooc-view.html +0 -185
- package/demo/ox-data-sample-view.html +0 -150
- package/demo/ox-grist-editor-data-item-spec.html +0 -476
- package/dist/src/ox-data-use-case.js.map +0 -1
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import '@material/mwc-icon';
|
|
3
|
+
import '@operato/property-editor/ox-property-editor-checkbox.js';
|
|
4
|
+
import '@operato/property-editor/ox-property-editor-number.js';
|
|
5
|
+
import '@operato/property-editor/ox-property-editor-string.js';
|
|
6
|
+
import '@operato/property-editor/ox-property-editor-options.js';
|
|
7
|
+
import '@operato/property-editor/ox-properties-dynamic-view.js';
|
|
8
|
+
import '@operato/data-grist/ox-filters-form.js';
|
|
9
|
+
import '@operato/data-grist/ox-sorters-control.js';
|
|
10
|
+
import '@operato/grist-editor'; /* regiester grist editors */
|
|
11
|
+
/* set grist-editors */
|
|
12
|
+
import '../src/grist-editor/index.js';
|
|
13
|
+
import '../src/usecase/ccp'; /* register usecase CCP */
|
|
14
|
+
import '../src/usecase/qc'; /* register usecase QC */
|
|
15
|
+
import { css, html, LitElement } from 'lit';
|
|
16
|
+
import { state } from 'lit/decorators.js';
|
|
17
|
+
// import { OxGristEditorCrontab } from '@operato/grist-editor/ox-grist-editor-crontab.js'
|
|
18
|
+
// import { OxGristEditorParameters } from '@operato/grist-editor/ox-grist-editor-parameters.js'
|
|
19
|
+
// import { OxGristEditorPartitionKeys } from '@operato/grist-editor/ox-grist-editor-partition-keys.js'
|
|
20
|
+
// // import { OxGristRendererCrontab } from '@operato/grist-editor/ox-grist-renderer-crontab.js'
|
|
21
|
+
// import { OxGristEditorValueMap } from '@operato/grist-editor/ox-grist-editor-value-map.js'
|
|
22
|
+
import { i18next } from '@operato/i18n';
|
|
23
|
+
import { OxPropertyEditor } from '@operato/property-editor';
|
|
24
|
+
import { CommonGristStyles } from '@operato/styles';
|
|
25
|
+
OxPropertyEditor.register({
|
|
26
|
+
number: 'ox-property-editor-number',
|
|
27
|
+
string: 'ox-property-editor-string',
|
|
28
|
+
boolean: 'ox-property-editor-checkbox',
|
|
29
|
+
options: 'ox-property-editor-options'
|
|
30
|
+
});
|
|
31
|
+
// registerEditor('parameters', OxGristEditorParameters)
|
|
32
|
+
// registerEditor('crontab', OxGristEditorCrontab)
|
|
33
|
+
// registerEditor('value-map', OxGristEditorValueMap)
|
|
34
|
+
// registerEditor('partition-keys', OxGristEditorPartitionKeys)
|
|
35
|
+
const fetchHandler = async ({ page = 1, limit = 100, sortings = [], filters = [] }) => {
|
|
36
|
+
var total = 10;
|
|
37
|
+
var start = (page - 1) * limit;
|
|
38
|
+
return {
|
|
39
|
+
total,
|
|
40
|
+
records: Array(limit * page > total ? total % limit : limit)
|
|
41
|
+
.fill('')
|
|
42
|
+
.map((item, idx) => {
|
|
43
|
+
return {
|
|
44
|
+
id: idx,
|
|
45
|
+
name: `name-${start + idx + 1}`,
|
|
46
|
+
description: `description-${start + idx + 1}`,
|
|
47
|
+
sequence: idx + 1,
|
|
48
|
+
active: true,
|
|
49
|
+
tag: `tag-${idx + 1}`,
|
|
50
|
+
type: idx % 3 === 0 ? 'select' : idx % 3 === 1 ? 'number' : 'string',
|
|
51
|
+
spec: {
|
|
52
|
+
ccp: {
|
|
53
|
+
criticalLimits: 100,
|
|
54
|
+
targetLimits: 200
|
|
55
|
+
},
|
|
56
|
+
qc: {
|
|
57
|
+
criticalLimits: 300,
|
|
58
|
+
targetLimits: true
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
options: idx % 2 === 0
|
|
62
|
+
? {
|
|
63
|
+
options: [
|
|
64
|
+
{
|
|
65
|
+
text: 'A',
|
|
66
|
+
value: 'a'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
text: 'B',
|
|
70
|
+
value: 'b'
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
: undefined,
|
|
75
|
+
schedule: '* * * * * *',
|
|
76
|
+
keyvalue: {},
|
|
77
|
+
createdAt: Date.now(),
|
|
78
|
+
updatedAt: Date.now()
|
|
79
|
+
};
|
|
80
|
+
})
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
class GristDemo extends LitElement {
|
|
84
|
+
constructor() {
|
|
85
|
+
super(...arguments);
|
|
86
|
+
this.mode = 'CARD';
|
|
87
|
+
this.config = {
|
|
88
|
+
list: { fields: ['name', 'description', 'active'] },
|
|
89
|
+
columns: [
|
|
90
|
+
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
91
|
+
{
|
|
92
|
+
type: 'gutter',
|
|
93
|
+
gutterName: 'button',
|
|
94
|
+
icon: 'add',
|
|
95
|
+
handlers: {
|
|
96
|
+
click: 'record-copy'
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
100
|
+
{
|
|
101
|
+
type: 'gutter',
|
|
102
|
+
gutterName: 'button',
|
|
103
|
+
icon: 'arrow_upward',
|
|
104
|
+
handlers: {
|
|
105
|
+
click: 'move-up'
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
type: 'gutter',
|
|
110
|
+
gutterName: 'button',
|
|
111
|
+
icon: 'arrow_downward',
|
|
112
|
+
handlers: {
|
|
113
|
+
click: 'move-down'
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
type: 'number',
|
|
118
|
+
name: 'sequence',
|
|
119
|
+
hidden: true
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
type: 'string',
|
|
123
|
+
name: 'id',
|
|
124
|
+
hidden: true
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
type: 'string',
|
|
128
|
+
name: 'name',
|
|
129
|
+
header: i18next.t('field.name'),
|
|
130
|
+
record: {
|
|
131
|
+
editable: true
|
|
132
|
+
},
|
|
133
|
+
width: 140
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
type: 'string',
|
|
137
|
+
name: 'description',
|
|
138
|
+
header: i18next.t('field.description'),
|
|
139
|
+
record: {
|
|
140
|
+
editable: true
|
|
141
|
+
},
|
|
142
|
+
width: 180
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
type: 'checkbox',
|
|
146
|
+
name: 'active',
|
|
147
|
+
label: true,
|
|
148
|
+
header: i18next.t('field.active'),
|
|
149
|
+
record: {
|
|
150
|
+
editable: true
|
|
151
|
+
},
|
|
152
|
+
sortable: true,
|
|
153
|
+
width: 60
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
type: 'string',
|
|
157
|
+
name: 'tag',
|
|
158
|
+
header: i18next.t('field.tag'),
|
|
159
|
+
record: {
|
|
160
|
+
editable: true
|
|
161
|
+
},
|
|
162
|
+
width: 180
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
type: 'select',
|
|
166
|
+
name: 'type',
|
|
167
|
+
header: i18next.t('field.type'),
|
|
168
|
+
record: {
|
|
169
|
+
options: ['', 'number', 'text', 'select', 'boolean', 'file'],
|
|
170
|
+
editable: true
|
|
171
|
+
},
|
|
172
|
+
width: 120
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
type: 'crontab',
|
|
176
|
+
name: 'schedule',
|
|
177
|
+
header: i18next.t('field.schedule'),
|
|
178
|
+
record: {
|
|
179
|
+
editable: true
|
|
180
|
+
},
|
|
181
|
+
width: 120
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
type: 'partition-keys',
|
|
185
|
+
name: 'keyvalue',
|
|
186
|
+
header: i18next.t('field.keyvalue'),
|
|
187
|
+
record: {
|
|
188
|
+
editable: true,
|
|
189
|
+
options: {
|
|
190
|
+
objectified: true,
|
|
191
|
+
valuetype: 'string'
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
width: 120
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
type: 'parameters',
|
|
198
|
+
name: 'options',
|
|
199
|
+
header: i18next.t('field.options'),
|
|
200
|
+
record: {
|
|
201
|
+
editable: true,
|
|
202
|
+
renderer: (value) => {
|
|
203
|
+
return typeof value === 'string' ? value : typeof value === 'object' ? JSON.stringify(value) : '';
|
|
204
|
+
},
|
|
205
|
+
options: async (value, column, record, row, field) => {
|
|
206
|
+
return {
|
|
207
|
+
name: record.type,
|
|
208
|
+
help: '',
|
|
209
|
+
spec: record.type === 'select'
|
|
210
|
+
? [
|
|
211
|
+
{
|
|
212
|
+
type: 'options',
|
|
213
|
+
name: 'options',
|
|
214
|
+
label: 'options'
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
: [],
|
|
218
|
+
context: this.grist,
|
|
219
|
+
objectified: true /* tell parameters editor not to need to parse */
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
width: 120
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
type: 'string',
|
|
227
|
+
name: 'unit',
|
|
228
|
+
header: i18next.t('field.unit'),
|
|
229
|
+
record: {
|
|
230
|
+
editable: true
|
|
231
|
+
},
|
|
232
|
+
width: 120
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
type: 'number',
|
|
236
|
+
name: 'quota',
|
|
237
|
+
header: i18next.t('field.quota'),
|
|
238
|
+
record: {
|
|
239
|
+
editable: true
|
|
240
|
+
},
|
|
241
|
+
width: 60
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
type: 'data-item-spec',
|
|
245
|
+
name: 'spec',
|
|
246
|
+
header: i18next.t('field.spec'),
|
|
247
|
+
record: {
|
|
248
|
+
editable: true,
|
|
249
|
+
options: {
|
|
250
|
+
name,
|
|
251
|
+
objectified: true
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
width: 200
|
|
255
|
+
}
|
|
256
|
+
],
|
|
257
|
+
rows: {
|
|
258
|
+
selectable: {
|
|
259
|
+
multiple: true
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
pagination: {
|
|
263
|
+
infinite: true
|
|
264
|
+
},
|
|
265
|
+
sorters: [
|
|
266
|
+
{
|
|
267
|
+
name: 'sequence'
|
|
268
|
+
}
|
|
269
|
+
]
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
get grist() {
|
|
273
|
+
return this.renderRoot.querySelector('ox-grist');
|
|
274
|
+
}
|
|
275
|
+
render() {
|
|
276
|
+
const mode = this.mode || 'CARD';
|
|
277
|
+
return html `
|
|
278
|
+
<ox-grist .config=${this.config} .mode=${mode} auto-fetch .fetchHandler=${fetchHandler}>
|
|
279
|
+
<div id="filters" slot="headroom">
|
|
280
|
+
<ox-filters-form @filters-change=${(e) => console.log('changed', e.detail)}></ox-filters-form>
|
|
281
|
+
</div>
|
|
282
|
+
|
|
283
|
+
<div slot="headroom" id="headroom">
|
|
284
|
+
<div id="modes">
|
|
285
|
+
<mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>view_list</mwc-icon>
|
|
286
|
+
<mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>menu</mwc-icon>
|
|
287
|
+
<mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
|
|
288
|
+
</div>
|
|
289
|
+
</div>
|
|
290
|
+
</ox-grist>
|
|
291
|
+
`;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
GristDemo.styles = [
|
|
295
|
+
CommonGristStyles,
|
|
296
|
+
css `
|
|
297
|
+
:host {
|
|
298
|
+
display: flex;
|
|
299
|
+
flex-direction: column;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
#tailer {
|
|
303
|
+
display: flex;
|
|
304
|
+
flex-direction: row;
|
|
305
|
+
margin: 0 var(--margin-default);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
#tailer a {
|
|
309
|
+
padding: 0 var(--padding-default) 0 var(--padding-default);
|
|
310
|
+
margin: 0 var(--margin-narrow);
|
|
311
|
+
border-right: 1px solid rgba(0, 0, 0, 0.1);
|
|
312
|
+
font-size: var(--fontsize-default);
|
|
313
|
+
color: var(--primary-color);
|
|
314
|
+
}
|
|
315
|
+
`
|
|
316
|
+
];
|
|
317
|
+
__decorate([
|
|
318
|
+
state()
|
|
319
|
+
], GristDemo.prototype, "mode", void 0);
|
|
320
|
+
customElements.define('ox-data-items', GristDemo);
|
|
321
|
+
export default {
|
|
322
|
+
title: 'ox-grist-editor-data-item-spec',
|
|
323
|
+
component: 'ox-grist-editor-data-item-spec',
|
|
324
|
+
argTypes: {}
|
|
325
|
+
};
|
|
326
|
+
const Template = ({}) => html `
|
|
327
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
|
328
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
329
|
+
<link href="/themes/oops-theme.css" rel="stylesheet" />
|
|
330
|
+
<link href="/themes/grist-theme.css" rel="stylesheet" />
|
|
331
|
+
|
|
332
|
+
<style>
|
|
333
|
+
[slot='headroom'] {
|
|
334
|
+
display: flex;
|
|
335
|
+
flex-direction: row;
|
|
336
|
+
align-items: center;
|
|
337
|
+
padding: var(--padding-default) var(--padding-wide);
|
|
338
|
+
border-top: 2px solid rgba(0, 0, 0, 0.2);
|
|
339
|
+
background-color: var(--theme-white-color);
|
|
340
|
+
box-shadow: var(--box-shadow);
|
|
341
|
+
|
|
342
|
+
--mdc-icon-size: 24px;
|
|
343
|
+
}
|
|
344
|
+
#sorters mwc-icon,
|
|
345
|
+
#modes mwc-icon {
|
|
346
|
+
--mdc-icon-size: 18px;
|
|
347
|
+
}
|
|
348
|
+
#sorters {
|
|
349
|
+
margin-left: auto;
|
|
350
|
+
margin-right: var(--margin-default);
|
|
351
|
+
padding-left: var(--padding-narrow);
|
|
352
|
+
border-bottom: var(--border-dark-color);
|
|
353
|
+
position: relative;
|
|
354
|
+
color: var(--secondary-color);
|
|
355
|
+
font-size: var(--fontsize-default);
|
|
356
|
+
user-select: none;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
#sorters > * {
|
|
360
|
+
padding: var(--padding-narrow);
|
|
361
|
+
vertical-align: middle;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
#filters {
|
|
365
|
+
display: flex;
|
|
366
|
+
justify-content: center;
|
|
367
|
+
align-items: center;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
#filters * {
|
|
371
|
+
margin-right: var(--margin-default);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
@media only screen and (max-width: 460px) {
|
|
375
|
+
#filters {
|
|
376
|
+
flex-direction: column;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
#modes {
|
|
380
|
+
display: none;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
</style>
|
|
384
|
+
|
|
385
|
+
<ox-data-items mode="LIST"></ox-data-items>
|
|
386
|
+
`;
|
|
387
|
+
export const Regular = Template.bind({});
|
|
388
|
+
Regular.args = {};
|
|
389
|
+
//# sourceMappingURL=ox-grist-editor-data-item-spec.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-grist-editor-data-item-spec.stories.js","sourceRoot":"","sources":["../../stories/ox-grist-editor-data-item-spec.stories.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAC3B,OAAO,yDAAyD,CAAA;AAChE,OAAO,uDAAuD,CAAA;AAC9D,OAAO,uDAAuD,CAAA;AAC9D,OAAO,wDAAwD,CAAA;AAC/D,OAAO,wDAAwD,CAAA;AAC/D,OAAO,wCAAwC,CAAA;AAC/C,OAAO,2CAA2C,CAAA;AAClD,OAAO,uBAAuB,CAAA,CAAC,6BAA6B;AAC5D,uBAAuB;AACvB,OAAO,8BAA8B,CAAA;AACrC,OAAO,oBAAoB,CAAA,CAAC,0BAA0B;AACtD,OAAO,mBAAmB,CAAA,CAAC,yBAAyB;AAEpD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGzC,0FAA0F;AAC1F,gGAAgG;AAChG,uGAAuG;AACvG,iGAAiG;AACjG,6FAA6F;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAEnD,gBAAg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,IAAI,MAAM,CAAA;QAEhC,OAAO,IAAI,CAAA;0BACW,IAAI,CAAC,MAAM,UAAU,IAAI,6BAA6B,YAAY;;6CAE/C,CAAC,CAAc,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC;;;;;+BAKlE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,YAAY,IAAI,IAAI,MAAM;+BACpD,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,YAAY,IAAI,IAAI,MAAM;+BACpD,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,YAAY,IAAI,IAAI,MAAM;;;;KAI9E,CAAA;IACH,CAAC;;AA1OM,gBAAM,GAAG;IACd,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;KAmBF;CACF,CAAA;AAEQ;IAAR,KAAK,EAAE;uCAAsB;AAqNhC,cAAc,CAAC,MAAM,CAAC,eAAe,EAAE,SAAS,CAAC,CAAA;AAEjD,eAAe;IACb,KAAK,EAAE,gCAAgC;IACvC,SAAS,EAAE,gCAAgC;IAC3C,QAAQ,EAAE,EAAE;CACb,CAAA;AAUD,MAAM,QAAQ,GAAoB,CAAC,EAAY,EAAE,EAAE,CACjD,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DH,CAAA;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG,EAAE,CAAA","sourcesContent":["import '@material/mwc-icon'\nimport '@operato/property-editor/ox-property-editor-checkbox.js'\nimport '@operato/property-editor/ox-property-editor-number.js'\nimport '@operato/property-editor/ox-property-editor-string.js'\nimport '@operato/property-editor/ox-property-editor-options.js'\nimport '@operato/property-editor/ox-properties-dynamic-view.js'\nimport '@operato/data-grist/ox-filters-form.js'\nimport '@operato/data-grist/ox-sorters-control.js'\nimport '@operato/grist-editor' /* regiester grist editors */\n/* set grist-editors */\nimport '../src/grist-editor/index.js'\nimport '../src/usecase/ccp' /* register usecase CCP */\nimport '../src/usecase/qc' /* register usecase QC */\n\nimport { css, html, LitElement, TemplateResult } from 'lit'\nimport { state } from 'lit/decorators.js'\n\nimport { FetchOption, GristRecord } from '@operato/data-grist'\n// import { OxGristEditorCrontab } from '@operato/grist-editor/ox-grist-editor-crontab.js'\n// import { OxGristEditorParameters } from '@operato/grist-editor/ox-grist-editor-parameters.js'\n// import { OxGristEditorPartitionKeys } from '@operato/grist-editor/ox-grist-editor-partition-keys.js'\n// // import { OxGristRendererCrontab } from '@operato/grist-editor/ox-grist-renderer-crontab.js'\n// import { OxGristEditorValueMap } from '@operato/grist-editor/ox-grist-editor-value-map.js'\nimport { i18next } from '@operato/i18n'\nimport { OxPropertyEditor } from '@operato/property-editor'\nimport { CommonGristStyles } from '@operato/styles'\n\nOxPropertyEditor.register({\n number: 'ox-property-editor-number',\n string: 'ox-property-editor-string',\n boolean: 'ox-property-editor-checkbox',\n options: 'ox-property-editor-options'\n})\n\n// registerEditor('parameters', OxGristEditorParameters)\n// registerEditor('crontab', OxGristEditorCrontab)\n// registerEditor('value-map', OxGristEditorValueMap)\n// registerEditor('partition-keys', OxGristEditorPartitionKeys)\n\nconst fetchHandler = async ({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) => {\n var total = 10\n var start = (page - 1) * limit\n\n return {\n total,\n records: Array(limit * page > total ? total % limit : limit)\n .fill('')\n .map((item, idx) => {\n return {\n id: idx,\n name: `name-${start + idx + 1}`,\n description: `description-${start + idx + 1}`,\n sequence: idx + 1,\n active: true,\n tag: `tag-${idx + 1}`,\n type: idx % 3 === 0 ? 'select' : idx % 3 === 1 ? 'number' : 'string',\n spec: {\n ccp: {\n criticalLimits: 100,\n targetLimits: 200\n },\n qc: {\n criticalLimits: 300,\n targetLimits: true\n }\n },\n options:\n idx % 2 === 0\n ? {\n options: [\n {\n text: 'A',\n value: 'a'\n },\n {\n text: 'B',\n value: 'b'\n }\n ]\n }\n : undefined,\n schedule: '* * * * * *',\n keyvalue: {},\n createdAt: Date.now(),\n updatedAt: Date.now()\n }\n })\n }\n}\n\nclass GristDemo extends LitElement {\n static styles = [\n CommonGristStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n }\n\n #tailer {\n display: flex;\n flex-direction: row;\n margin: 0 var(--margin-default);\n }\n\n #tailer a {\n padding: 0 var(--padding-default) 0 var(--padding-default);\n margin: 0 var(--margin-narrow);\n border-right: 1px solid rgba(0, 0, 0, 0.1);\n font-size: var(--fontsize-default);\n color: var(--primary-color);\n }\n `\n ]\n\n @state() mode: String = 'CARD'\n\n get grist() {\n return this.renderRoot.querySelector('ox-grist')\n }\n\n config: any = {\n list: { fields: ['name', 'description', 'active'] },\n columns: [\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'add',\n handlers: {\n click: 'record-copy'\n }\n },\n { type: 'gutter', gutterName: 'sequence' },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_upward',\n handlers: {\n click: 'move-up'\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_downward',\n handlers: {\n click: 'move-down'\n }\n },\n {\n type: 'number',\n name: 'sequence',\n hidden: true\n },\n {\n type: 'string',\n name: 'id',\n hidden: true\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: true\n },\n width: 140\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: true\n },\n width: 180\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: {\n editable: true\n },\n sortable: true,\n width: 60\n },\n {\n type: 'string',\n name: 'tag',\n header: i18next.t('field.tag'),\n record: {\n editable: true\n },\n width: 180\n },\n {\n type: 'select',\n name: 'type',\n header: i18next.t('field.type'),\n record: {\n options: ['', 'number', 'text', 'select', 'boolean', 'file'],\n editable: true\n },\n width: 120\n },\n {\n type: 'crontab',\n name: 'schedule',\n header: i18next.t('field.schedule'),\n record: {\n editable: true\n },\n width: 120\n },\n {\n type: 'partition-keys',\n name: 'keyvalue',\n header: i18next.t('field.keyvalue'),\n record: {\n editable: true,\n options: {\n objectified: true,\n valuetype: 'string'\n }\n },\n width: 120\n },\n {\n type: 'parameters',\n name: 'options',\n header: i18next.t('field.options'),\n record: {\n editable: true,\n renderer: (value: any) => {\n return typeof value === 'string' ? value : typeof value === 'object' ? JSON.stringify(value) : ''\n },\n options: async (value: any, column: any, record: GristRecord, row: GristRecord, field: any) => {\n return {\n name: record.type,\n help: '',\n spec:\n record.type === 'select'\n ? [\n {\n type: 'options',\n name: 'options',\n label: 'options'\n }\n ]\n : [],\n context: this.grist,\n objectified: true /* tell parameters editor not to need to parse */\n }\n }\n },\n width: 120\n },\n {\n type: 'string',\n name: 'unit',\n header: i18next.t('field.unit'),\n record: {\n editable: true\n },\n width: 120\n },\n {\n type: 'number',\n name: 'quota',\n header: i18next.t('field.quota'),\n record: {\n editable: true\n },\n width: 60\n },\n {\n type: 'data-item-spec',\n name: 'spec',\n header: i18next.t('field.spec'),\n record: {\n editable: true,\n options: {\n name,\n objectified: true\n }\n },\n width: 200\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n pagination: {\n infinite: true\n },\n sorters: [\n {\n name: 'sequence'\n }\n ]\n }\n\n render() {\n const mode = this.mode || 'CARD'\n\n return html`\n <ox-grist .config=${this.config} .mode=${mode} auto-fetch .fetchHandler=${fetchHandler}>\n <div id=\"filters\" slot=\"headroom\">\n <ox-filters-form @filters-change=${(e: CustomEvent) => console.log('changed', e.detail)}></ox-filters-form>\n </div>\n\n <div slot=\"headroom\" id=\"headroom\">\n <div id=\"modes\">\n <mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>view_list</mwc-icon>\n <mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>menu</mwc-icon>\n <mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>\n </div>\n </div>\n </ox-grist>\n `\n }\n}\n\ncustomElements.define('ox-data-items', GristDemo)\n\nexport default {\n title: 'ox-grist-editor-data-item-spec',\n component: 'ox-grist-editor-data-item-spec',\n argTypes: {}\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {}\n\nconst Template: Story<ArgTypes> = ({}: ArgTypes) =>\n html`\n <link href=\"https://fonts.googleapis.com/css?family=Material+Icons&display=block\" rel=\"stylesheet\" />\n <link href=\"/themes/app-theme.css\" rel=\"stylesheet\" />\n <link href=\"/themes/oops-theme.css\" rel=\"stylesheet\" />\n <link href=\"/themes/grist-theme.css\" rel=\"stylesheet\" />\n\n <style>\n [slot='headroom'] {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: var(--padding-default) var(--padding-wide);\n border-top: 2px solid rgba(0, 0, 0, 0.2);\n background-color: var(--theme-white-color);\n box-shadow: var(--box-shadow);\n\n --mdc-icon-size: 24px;\n }\n #sorters mwc-icon,\n #modes mwc-icon {\n --mdc-icon-size: 18px;\n }\n #sorters {\n margin-left: auto;\n margin-right: var(--margin-default);\n padding-left: var(--padding-narrow);\n border-bottom: var(--border-dark-color);\n position: relative;\n color: var(--secondary-color);\n font-size: var(--fontsize-default);\n user-select: none;\n }\n\n #sorters > * {\n padding: var(--padding-narrow);\n vertical-align: middle;\n }\n\n #filters {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n #filters * {\n margin-right: var(--margin-default);\n }\n\n @media only screen and (max-width: 460px) {\n #filters {\n flex-direction: column;\n }\n\n #modes {\n display: none;\n }\n }\n </style>\n\n <ox-data-items mode=\"LIST\"></ox-data-items>\n `\n\nexport const Regular = Template.bind({})\nRegular.args = {}\n"]}
|