@operato/dataset 10.29.81 → 10.29.84

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/dist/stories/ox-checklist-entry-form.stories.d.ts +18 -0
  2. package/dist/stories/ox-checklist-entry-form.stories.js +194 -0
  3. package/dist/stories/ox-data-entry-form-subgroups.stories.d.ts +19 -0
  4. package/dist/stories/ox-data-entry-form-subgroups.stories.js +250 -0
  5. package/dist/stories/ox-data-entry-form.stories.d.ts +19 -0
  6. package/dist/stories/ox-data-entry-form.stories.js +278 -0
  7. package/dist/stories/ox-data-item-spec.stories.d.ts +26 -0
  8. package/dist/stories/ox-data-item-spec.stories.js +234 -0
  9. package/dist/stories/ox-data-ooc-brief-view.stories.d.ts +19 -0
  10. package/dist/stories/ox-data-ooc-brief-view.stories.js +320 -0
  11. package/dist/stories/ox-data-ooc-view.stories.d.ts +19 -0
  12. package/dist/stories/ox-data-ooc-view.stories.js +314 -0
  13. package/dist/stories/ox-data-sample-view.stories.d.ts +19 -0
  14. package/dist/stories/ox-data-sample-view.stories.js +300 -0
  15. package/dist/stories/ox-grist-editor-data-item-spec.stories.d.ts +27 -0
  16. package/dist/stories/ox-grist-editor-data-item-spec.stories.js +394 -0
  17. package/package.json +26 -12
  18. package/CHANGELOG.md +0 -7219
  19. package/dist/src/grist-editor/index.js.map +0 -1
  20. package/dist/src/grist-editor/ox-grist-editor-data-item-spec.js.map +0 -1
  21. package/dist/src/grist-editor/ox-popup-data-item-spec.js.map +0 -1
  22. package/dist/src/index.js.map +0 -1
  23. package/dist/src/ox-checklist-entry-form.js.map +0 -1
  24. package/dist/src/ox-checklist-sample-view.js.map +0 -1
  25. package/dist/src/ox-data-entry-form.js.map +0 -1
  26. package/dist/src/ox-data-entry-subgroup-form.js.map +0 -1
  27. package/dist/src/ox-data-entry-subgroup-view.js.map +0 -1
  28. package/dist/src/ox-data-entry-view.js.map +0 -1
  29. package/dist/src/ox-data-input-factory.js.map +0 -1
  30. package/dist/src/ox-data-item-spec.js.map +0 -1
  31. package/dist/src/ox-data-ooc-badge.js.map +0 -1
  32. package/dist/src/ox-data-ooc-brief-view.js.map +0 -1
  33. package/dist/src/ox-data-ooc-correction-part.js.map +0 -1
  34. package/dist/src/ox-data-ooc-history.js.map +0 -1
  35. package/dist/src/ox-data-ooc-view.js.map +0 -1
  36. package/dist/src/ox-data-sample-subgroup-view.js.map +0 -1
  37. package/dist/src/ox-data-sample-view.js.map +0 -1
  38. package/dist/src/ox-data-summary-view.js.map +0 -1
  39. package/dist/src/types.js.map +0 -1
  40. package/dist/src/usecase/ccp/index.js.map +0 -1
  41. package/dist/src/usecase/ccp/ox-data-use-case-ccp.js.map +0 -1
  42. package/dist/src/usecase/ccp/ox-input-ccp-limits.js.map +0 -1
  43. package/dist/src/usecase/ccp/ox-property-editor-ccp-limits.js.map +0 -1
  44. package/dist/src/usecase/ox-data-use-case.js.map +0 -1
  45. package/dist/src/usecase/qc/index.js.map +0 -1
  46. package/dist/src/usecase/qc/ox-data-use-case-qc.js.map +0 -1
  47. package/dist/src/usecase/qc/ox-input-qc-limits.js.map +0 -1
  48. package/dist/src/usecase/qc/ox-property-editor-qc-limits.js.map +0 -1
  49. package/dist/src/usecase/spc/index.js.map +0 -1
  50. package/dist/src/usecase/spc/ox-data-use-case-spc.js.map +0 -1
  51. package/dist/src/usecase/spc/ox-input-spc-limits.js.map +0 -1
  52. package/dist/src/usecase/spc/ox-property-editor-spc-limits.js.map +0 -1
  53. package/dist/test/date-item.test.d.ts +0 -2
  54. package/dist/test/date-item.test.js +0 -49
  55. package/dist/test/date-item.test.js.map +0 -1
  56. package/dist/tsconfig.tsbuildinfo +0 -1
  57. package/test/date-item.test.ts +0 -55
@@ -0,0 +1,394 @@
1
+ import { __decorate } from "tslib";
2
+ import '@material/web/icon/icon.js';
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/index.js'; /* register usecase CCP */
14
+ import '../src/usecase/qc/index.js'; /* register usecase QC */
15
+ import { css, html, LitElement } from 'lit';
16
+ import { state } from 'lit/decorators.js';
17
+ import { i18next } from '@operato/i18n';
18
+ import { OxPropertyEditor } from '@operato/property-editor';
19
+ import { CommonGristStyles } from '@operato/styles';
20
+ OxPropertyEditor.register({
21
+ number: 'ox-property-editor-number',
22
+ string: 'ox-property-editor-string',
23
+ boolean: 'ox-property-editor-checkbox',
24
+ options: 'ox-property-editor-options'
25
+ });
26
+ const fetchHandler = async ({ page = 1, limit = 100, sortings = [], filters = [] }) => {
27
+ var total = 10;
28
+ var start = (page - 1) * limit;
29
+ return {
30
+ total,
31
+ records: Array(limit * page > total ? total % limit : limit)
32
+ .fill('')
33
+ .map((item, idx) => {
34
+ return {
35
+ id: idx,
36
+ name: `name-${start + idx + 1}`,
37
+ description: `description-${start + idx + 1}`,
38
+ sequence: idx + 1,
39
+ active: true,
40
+ tag: `tag-${idx + 1}`,
41
+ type: idx % 3 === 0 ? 'select' : idx % 3 === 1 ? 'number' : 'string',
42
+ spec: {
43
+ ccp: {
44
+ criticalLimits: 100,
45
+ targetLimits: 200
46
+ },
47
+ qc: {
48
+ criticalLimits: 300,
49
+ targetLimits: true
50
+ }
51
+ },
52
+ options: idx % 2 === 0
53
+ ? {
54
+ options: [
55
+ {
56
+ text: 'A',
57
+ value: 'a'
58
+ },
59
+ {
60
+ text: 'B',
61
+ value: 'b'
62
+ }
63
+ ]
64
+ }
65
+ : undefined,
66
+ schedule: '* * * * * *',
67
+ keyvalue: {},
68
+ createdAt: Date.now(),
69
+ updatedAt: Date.now()
70
+ };
71
+ })
72
+ };
73
+ };
74
+ class GristDemo extends LitElement {
75
+ constructor() {
76
+ super(...arguments);
77
+ this.mode = 'CARD';
78
+ this.config = {
79
+ list: { fields: ['name', 'description', 'active'] },
80
+ columns: [
81
+ { type: 'gutter', gutterName: 'row-selector', multiple: true },
82
+ {
83
+ type: 'gutter',
84
+ gutterName: 'button',
85
+ icon: 'add',
86
+ handlers: {
87
+ click: 'record-copy'
88
+ }
89
+ },
90
+ { type: 'gutter', gutterName: 'sequence' },
91
+ {
92
+ type: 'gutter',
93
+ gutterName: 'button',
94
+ icon: 'arrow_upward',
95
+ handlers: {
96
+ click: 'move-up'
97
+ }
98
+ },
99
+ {
100
+ type: 'gutter',
101
+ gutterName: 'button',
102
+ icon: 'arrow_downward',
103
+ handlers: {
104
+ click: 'move-down'
105
+ }
106
+ },
107
+ {
108
+ type: 'number',
109
+ name: 'sequence',
110
+ hidden: true
111
+ },
112
+ {
113
+ type: 'string',
114
+ name: 'id',
115
+ hidden: true
116
+ },
117
+ {
118
+ type: 'string',
119
+ name: 'name',
120
+ header: i18next.t('field.name'),
121
+ record: {
122
+ editable: true
123
+ },
124
+ width: 140
125
+ },
126
+ {
127
+ type: 'string',
128
+ name: 'description',
129
+ header: i18next.t('field.description'),
130
+ record: {
131
+ editable: true
132
+ },
133
+ width: 180
134
+ },
135
+ {
136
+ type: 'checkbox',
137
+ name: 'active',
138
+ label: true,
139
+ header: i18next.t('field.active'),
140
+ record: {
141
+ editable: true
142
+ },
143
+ sortable: true,
144
+ width: 60
145
+ },
146
+ {
147
+ type: 'string',
148
+ name: 'tag',
149
+ header: i18next.t('field.tag'),
150
+ record: {
151
+ editable: true
152
+ },
153
+ width: 180
154
+ },
155
+ {
156
+ type: 'select',
157
+ name: 'type',
158
+ header: i18next.t('field.type'),
159
+ record: {
160
+ options: ['', 'number', 'text', 'select', 'boolean', 'file', 'signature'],
161
+ editable: true
162
+ },
163
+ width: 120
164
+ },
165
+ {
166
+ type: 'crontab',
167
+ name: 'schedule',
168
+ header: i18next.t('field.schedule'),
169
+ record: {
170
+ editable: true
171
+ },
172
+ width: 120
173
+ },
174
+ {
175
+ type: 'partition-keys',
176
+ name: 'keyvalue',
177
+ header: i18next.t('field.keyvalue'),
178
+ record: {
179
+ editable: true,
180
+ options: {
181
+ objectified: true,
182
+ valuetype: 'string'
183
+ }
184
+ },
185
+ width: 120
186
+ },
187
+ {
188
+ type: 'parameters',
189
+ name: 'options',
190
+ header: i18next.t('field.options'),
191
+ record: {
192
+ editable: true,
193
+ renderer: (value) => {
194
+ return typeof value === 'string' ? value : typeof value === 'object' ? JSON.stringify(value) : '';
195
+ },
196
+ options: async (value, column, record, row, field) => {
197
+ return {
198
+ name: record.type,
199
+ help: '',
200
+ spec: record.type === 'select'
201
+ ? [
202
+ {
203
+ type: 'options',
204
+ name: 'options',
205
+ label: 'options'
206
+ }
207
+ ]
208
+ : [],
209
+ context: this.grist,
210
+ objectified: true /* tell parameters editor not to need to parse */
211
+ };
212
+ }
213
+ },
214
+ width: 120
215
+ },
216
+ {
217
+ type: 'string',
218
+ name: 'unit',
219
+ header: i18next.t('field.unit'),
220
+ record: {
221
+ editable: true
222
+ },
223
+ width: 120
224
+ },
225
+ {
226
+ type: 'number',
227
+ name: 'quota',
228
+ header: i18next.t('field.quota'),
229
+ record: {
230
+ editable: true
231
+ },
232
+ width: 60
233
+ },
234
+ {
235
+ type: 'data-item-spec',
236
+ name: 'spec',
237
+ header: i18next.t('field.spec'),
238
+ record: {
239
+ editable: true,
240
+ options: {
241
+ name,
242
+ objectified: true
243
+ }
244
+ },
245
+ width: 200
246
+ }
247
+ ],
248
+ rows: {
249
+ selectable: {
250
+ multiple: true
251
+ }
252
+ },
253
+ pagination: {
254
+ infinite: true
255
+ },
256
+ sorters: [
257
+ {
258
+ name: 'sequence'
259
+ }
260
+ ]
261
+ };
262
+ }
263
+ get grist() {
264
+ return this.renderRoot.querySelector('ox-grist');
265
+ }
266
+ render() {
267
+ const mode = this.mode || 'CARD';
268
+ return html `
269
+ <ox-grist .config=${this.config} .mode=${mode} auto-fetch .fetchHandler=${fetchHandler}>
270
+ <div id="filters" slot="headroom">
271
+ <ox-filters-form @filters-change=${(e) => console.log('changed', e.detail)}></ox-filters-form>
272
+ </div>
273
+
274
+ <div slot="headroom" id="headroom">
275
+ <div id="modes">
276
+ <md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>view_list</md-icon>
277
+ <md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>menu</md-icon>
278
+ <md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
279
+ </div>
280
+ </div>
281
+ </ox-grist>
282
+ `;
283
+ }
284
+ }
285
+ GristDemo.styles = [
286
+ CommonGristStyles,
287
+ css `
288
+ :host {
289
+ display: flex;
290
+ flex-direction: column;
291
+ }
292
+
293
+ #tailer {
294
+ display: flex;
295
+ flex-direction: row;
296
+ margin: 0 var(--spacing-medium);
297
+ }
298
+
299
+ #tailer a {
300
+ padding: 0 var(--padding-default) 0 var(--padding-default);
301
+ margin: 0 var(--spacing-small);
302
+ border-right: 1px solid rgba(0, 0, 0, 0.1);
303
+ font-size: var(--fontsize-default);
304
+ color: var(--md-sys-color-on-primary-container);
305
+ }
306
+ `
307
+ ];
308
+ __decorate([
309
+ state()
310
+ ], GristDemo.prototype, "mode", void 0);
311
+ customElements.define('ox-data-items', GristDemo);
312
+ export default {
313
+ title: 'ox-grist-editor-data-item-spec',
314
+ component: 'ox-grist-editor-data-item-spec',
315
+ argTypes: {}
316
+ };
317
+ const Template = ({}) => html `
318
+ <link
319
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
320
+ rel="stylesheet"
321
+ />
322
+ <link
323
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
324
+ rel="stylesheet"
325
+ />
326
+ <link
327
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
328
+ rel="stylesheet"
329
+ />
330
+
331
+ <link href="/themes/app-theme.css" rel="stylesheet" />
332
+ <link href="/themes/light.css" rel="stylesheet" />
333
+ <link href="/themes/dark.css" rel="stylesheet" />
334
+ <link href="/themes/spacing.css" rel="stylesheet" />
335
+ <link href="/themes/grist-theme.css" rel="stylesheet" />
336
+ <link href="/themes/form-theme.css" rel="stylesheet" />
337
+
338
+ <style>
339
+ [slot='headroom'] {
340
+ display: flex;
341
+ flex-direction: row;
342
+ align-items: center;
343
+ padding: var(--padding-default) var(--spacing-large);
344
+ background-color: var(--md-sys-color-surface);
345
+ box-shadow: var(--box-shadow);
346
+
347
+ --md-icon-size: 24px;
348
+ }
349
+ #sorters md-icon,
350
+ #modes md-icon {
351
+ --md-icon-size: 18px;
352
+ }
353
+ #sorters {
354
+ margin-left: auto;
355
+ margin-right: var(--spacing-medium);
356
+ padding-left: var(--spacing-small);
357
+ border-bottom: var(--border-dim-color);
358
+ position: relative;
359
+ color: var(--md-sys-color-on-secondary-container);
360
+ font-size: var(--fontsize-default);
361
+ user-select: none;
362
+ }
363
+
364
+ #sorters > * {
365
+ padding: var(--spacing-small);
366
+ vertical-align: middle;
367
+ }
368
+
369
+ #filters {
370
+ display: flex;
371
+ justify-content: center;
372
+ align-items: center;
373
+ }
374
+
375
+ #filters * {
376
+ margin-right: var(--spacing-medium);
377
+ }
378
+
379
+ @media only screen and (max-width: 460px) {
380
+ #filters {
381
+ flex-direction: column;
382
+ }
383
+
384
+ #modes {
385
+ display: none;
386
+ }
387
+ }
388
+ </style>
389
+
390
+ <ox-data-items mode="LIST"></ox-data-items>
391
+ `;
392
+ export const Regular = Template.bind({});
393
+ Regular.args = {};
394
+ //# sourceMappingURL=ox-grist-editor-data-item-spec.stories.js.map
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/dataset",
3
3
  "description": "WebApplication dataset supporting components following open-wc recommendations",
4
4
  "author": "heartyoh",
5
- "version": "10.29.81",
5
+ "version": "10.29.84",
6
6
  "type": "module",
7
7
  "main": "dist/src/index.js",
8
8
  "module": "dist/src/index.js",
@@ -31,6 +31,20 @@
31
31
  "./ox-property-editor-qc-limits.js": "./dist/src/usecase/qc/ox-property-editor-qc-limits.js",
32
32
  "./types.js": "./dist/src/types.js"
33
33
  },
34
+ "files": [
35
+ "README.md",
36
+ "dist",
37
+ "themes",
38
+ "translations",
39
+ "!**/*.map",
40
+ "!**/*.test.*",
41
+ "!**/*.spec.*",
42
+ "!**/test/**",
43
+ "!**/tests/**",
44
+ "!**/__tests__/**",
45
+ "!**/*.tsbuildinfo",
46
+ "!**/.DS_Store"
47
+ ],
34
48
  "typesVersions": {
35
49
  "*": {
36
50
  "usecase/ccp": [
@@ -117,16 +131,16 @@
117
131
  },
118
132
  "dependencies": {
119
133
  "@material/web": "^2.0.0",
120
- "@operato/data-grist": "^10.29.81",
121
- "@operato/graphql": "^10.29.79",
122
- "@operato/grist-editor": "^10.29.81",
123
- "@operato/i18n": "^10.29.27",
124
- "@operato/input": "^10.29.81",
125
- "@operato/popup": "^10.29.81",
126
- "@operato/property-editor": "^10.29.81",
127
- "@operato/shell": "^10.29.81",
128
- "@operato/styles": "^10.29.81",
129
- "@operato/utils": "^10.29.76",
134
+ "@operato/data-grist": "^10.29.84",
135
+ "@operato/graphql": "^10.29.83",
136
+ "@operato/grist-editor": "^10.29.84",
137
+ "@operato/i18n": "^10.29.83",
138
+ "@operato/input": "^10.29.83",
139
+ "@operato/popup": "^10.29.83",
140
+ "@operato/property-editor": "^10.29.84",
141
+ "@operato/shell": "^10.29.83",
142
+ "@operato/styles": "^10.29.83",
143
+ "@operato/utils": "^10.29.83",
130
144
  "lit": "^3.1.2"
131
145
  },
132
146
  "devDependencies": {
@@ -161,5 +175,5 @@
161
175
  "prettier --write"
162
176
  ]
163
177
  },
164
- "gitHead": "e59c974dc6f94baeea7e1b21224bb347bbd222a7"
178
+ "gitHead": "a6c30e4a03a2a71b4aba24f09853d8be78655147"
165
179
  }