@operato/app 1.0.0-alpha.21 → 1.0.0-alpha.24
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 +28 -90
- package/dist/src/{grist → grist-editor}/index.d.ts +0 -0
- package/dist/src/grist-editor/index.js +21 -0
- package/dist/src/grist-editor/index.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-editor-crontab.d.ts +8 -0
- package/dist/src/grist-editor/ox-grist-editor-crontab.js +50 -0
- package/dist/src/grist-editor/ox-grist-editor-crontab.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-editor-json.d.ts +7 -0
- package/dist/src/grist-editor/ox-grist-editor-json.js +54 -0
- package/dist/src/grist-editor/ox-grist-editor-json.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-editor-parameters.d.ts +12 -0
- package/dist/src/{grist/parameters-editor.js → grist-editor/ox-grist-editor-parameters.js} +16 -37
- package/dist/src/grist-editor/ox-grist-editor-parameters.js.map +1 -0
- package/dist/src/{grist/code-editor.d.ts → grist-editor/ox-grist-editor-resource-code.d.ts} +1 -1
- package/dist/src/{grist/code-editor.js → grist-editor/ox-grist-editor-resource-code.js} +6 -6
- package/dist/src/grist-editor/ox-grist-editor-resource-code.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-editor-resource-id.d.ts +10 -0
- package/dist/src/{grist/id-input.js → grist-editor/ox-grist-editor-resource-id.js} +17 -66
- package/dist/src/grist-editor/ox-grist-editor-resource-id.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-editor-resource-object.d.ts +11 -0
- package/dist/src/{grist/object-editor.js → grist-editor/ox-grist-editor-resource-object.js} +11 -62
- package/dist/src/grist-editor/ox-grist-editor-resource-object.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-editor-value-map.d.ts +11 -0
- package/dist/src/grist-editor/ox-grist-editor-value-map.js +74 -0
- package/dist/src/grist-editor/ox-grist-editor-value-map.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-renderer-resource-id.d.ts +2 -0
- package/dist/src/{grist/id-renderer.js → grist-editor/ox-grist-renderer-resource-id.js} +2 -2
- package/dist/src/grist-editor/ox-grist-renderer-resource-id.js.map +1 -0
- package/dist/src/{grist/parameters-editor-builder.d.ts → grist-editor/ox-parameters-builder.d.ts} +0 -0
- package/dist/src/{grist/parameters-editor-builder.js → grist-editor/ox-parameters-builder.js} +10 -10
- package/dist/src/grist-editor/ox-parameters-builder.js.map +1 -0
- package/dist/src/grist-editor/ox-popup-code-input.d.ts +12 -0
- package/dist/src/grist-editor/ox-popup-code-input.js +81 -0
- package/dist/src/grist-editor/ox-popup-code-input.js.map +1 -0
- package/dist/src/grist-editor/ox-popup-crontab-input.d.ts +11 -0
- package/dist/src/grist-editor/ox-popup-crontab-input.js +74 -0
- package/dist/src/grist-editor/ox-popup-crontab-input.js.map +1 -0
- package/dist/src/{grist/parameters-editor-popup.d.ts → grist-editor/ox-popup-parameters-builder.d.ts} +1 -1
- package/dist/src/{grist/parameters-editor-popup.js → grist-editor/ox-popup-parameters-builder.js} +15 -15
- package/dist/src/grist-editor/ox-popup-parameters-builder.js.map +1 -0
- package/dist/src/grist-editor/ox-popup-value-map-input.d.ts +12 -0
- package/dist/src/grist-editor/ox-popup-value-map-input.js +104 -0
- package/dist/src/grist-editor/ox-popup-value-map-input.js.map +1 -0
- package/dist/src/{grist/id-selector.d.ts → grist-editor/ox-selector-resource-id.d.ts} +1 -1
- package/dist/src/{grist/id-selector.js → grist-editor/ox-selector-resource-id.js} +15 -15
- package/dist/src/grist-editor/ox-selector-resource-id.js.map +1 -0
- package/dist/src/{grist/object-selector.d.ts → grist-editor/ox-selector-resource-object.d.ts} +1 -1
- package/dist/src/{grist/object-selector.js → grist-editor/ox-selector-resource-object.js} +20 -20
- package/dist/src/grist-editor/ox-selector-resource-object.js.map +1 -0
- package/dist/src/index.d.ts +3 -1
- package/dist/src/index.js +3 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/input/index.d.ts +3 -0
- package/dist/src/input/index.js +4 -0
- package/dist/src/input/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +28 -23
- package/src/grist-editor/index.ts +23 -0
- package/src/grist-editor/ox-grist-editor-crontab.ts +62 -0
- package/src/grist-editor/ox-grist-editor-json.ts +62 -0
- package/src/{grist/parameters-editor.ts → grist-editor/ox-grist-editor-parameters.ts} +13 -26
- package/src/{grist/code-editor.ts → grist-editor/ox-grist-editor-resource-code.ts} +2 -2
- package/src/grist-editor/ox-grist-editor-resource-id.ts +83 -0
- package/src/{grist/object-editor.ts → grist-editor/ox-grist-editor-resource-object.ts} +7 -46
- package/src/grist-editor/ox-grist-editor-value-map.ts +86 -0
- package/src/{grist/id-renderer.ts → grist-editor/ox-grist-renderer-resource-id.ts} +1 -1
- package/src/{grist/parameters-editor-builder.ts → grist-editor/ox-parameters-builder.ts} +4 -4
- package/src/grist-editor/ox-popup-code-input.ts +75 -0
- package/src/grist-editor/ox-popup-crontab-input.ts +74 -0
- package/src/{grist/parameters-editor-popup.ts → grist-editor/ox-popup-parameters-builder.ts} +5 -5
- package/src/grist-editor/ox-popup-value-map-input.ts +101 -0
- package/src/{grist/id-selector.ts → grist-editor/ox-selector-resource-id.ts} +2 -2
- package/src/{grist/object-selector.ts → grist-editor/ox-selector-resource-object.ts} +2 -2
- package/src/index.ts +3 -1
- package/src/input/index.ts +3 -0
- package/yarn-error.log +1 -1
- package/dist/src/grist/code-editor.js.map +0 -1
- package/dist/src/grist/id-input.d.ts +0 -19
- package/dist/src/grist/id-input.js.map +0 -1
- package/dist/src/grist/id-renderer.d.ts +0 -2
- package/dist/src/grist/id-renderer.js.map +0 -1
- package/dist/src/grist/id-selector.js.map +0 -1
- package/dist/src/grist/index.js +0 -11
- package/dist/src/grist/index.js.map +0 -1
- package/dist/src/grist/object-editor.d.ts +0 -18
- package/dist/src/grist/object-editor.js.map +0 -1
- package/dist/src/grist/object-selector.js.map +0 -1
- package/dist/src/grist/parameters-editor-builder.js.map +0 -1
- package/dist/src/grist/parameters-editor-popup.js.map +0 -1
- package/dist/src/grist/parameters-editor.d.ts +0 -19
- package/dist/src/grist/parameters-editor.js.map +0 -1
- package/src/grist/id-input.ts +0 -135
- package/src/grist/index.ts +0 -13
package/src/grist/id-input.ts
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import '@material/mwc-icon'
|
|
2
|
-
import './id-selector.js'
|
|
3
|
-
|
|
4
|
-
import { ColumnConfig, GristRecord, InputEditor } from '@operato/data-grist'
|
|
5
|
-
import { TemplateResult, css, html } from 'lit'
|
|
6
|
-
import { customElement, property } from 'lit/decorators.js'
|
|
7
|
-
|
|
8
|
-
import { openPopup } from '@operato/layout'
|
|
9
|
-
|
|
10
|
-
@customElement('ox-id-input')
|
|
11
|
-
export class IdInput extends InputEditor {
|
|
12
|
-
static styles = css`
|
|
13
|
-
:host {
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-flow: row nowrap;
|
|
16
|
-
align-items: center;
|
|
17
|
-
|
|
18
|
-
padding: 7px 0px;
|
|
19
|
-
box-sizing: border-box;
|
|
20
|
-
|
|
21
|
-
width: 100%;
|
|
22
|
-
height: 100%;
|
|
23
|
-
|
|
24
|
-
border: 0;
|
|
25
|
-
background-color: transparent;
|
|
26
|
-
|
|
27
|
-
font: var(--grist-object-editor-font);
|
|
28
|
-
color: var(--grist-object-editor-color);
|
|
29
|
-
|
|
30
|
-
justify-content: inherit;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
span {
|
|
34
|
-
display: flex;
|
|
35
|
-
flex: auto;
|
|
36
|
-
|
|
37
|
-
justify-content: inherit;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
mwc-icon {
|
|
41
|
-
width: 20px;
|
|
42
|
-
font-size: 1.5em;
|
|
43
|
-
margin-left: auto;
|
|
44
|
-
}
|
|
45
|
-
`
|
|
46
|
-
|
|
47
|
-
@property({ type: Object }) value?: { id?: string; [propany: string]: any }
|
|
48
|
-
@property({ type: Object }) column!: ColumnConfig
|
|
49
|
-
@property({ type: Object }) record!: GristRecord
|
|
50
|
-
@property({ type: Number }) row!: number
|
|
51
|
-
|
|
52
|
-
private popup?: {
|
|
53
|
-
name: string
|
|
54
|
-
close: () => void
|
|
55
|
-
closed: boolean
|
|
56
|
-
onclosed?: (() => void) | undefined
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
private template?: TemplateResult
|
|
60
|
-
|
|
61
|
-
render() {
|
|
62
|
-
var { nameField = 'name', descriptionField = 'description' } = this.column.record.options || {}
|
|
63
|
-
var value = this.value
|
|
64
|
-
|
|
65
|
-
return html`
|
|
66
|
-
${!value ? html`` : html` <span>${value[nameField]} (${value[descriptionField]})</span> `}
|
|
67
|
-
<mwc-icon>arrow_drop_down</mwc-icon>
|
|
68
|
-
`
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
async firstUpdated() {
|
|
72
|
-
this.value = this.record[this.column.name]
|
|
73
|
-
this.template = ((this.column.record || {}).options || {}).template
|
|
74
|
-
|
|
75
|
-
await this.updateComplete
|
|
76
|
-
|
|
77
|
-
this.renderRoot.addEventListener('click', e => {
|
|
78
|
-
e.stopPropagation()
|
|
79
|
-
|
|
80
|
-
this.openSelector()
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
this.openSelector()
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
openSelector() {
|
|
87
|
-
if (this.popup) {
|
|
88
|
-
delete this.popup
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
const confirmCallback: (record: GristRecord | undefined) => void = selected => {
|
|
92
|
-
if (!selected) {
|
|
93
|
-
return
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
var { idField = 'id', nameField = 'name', descriptionField = 'description' } = this.column.record.options || {}
|
|
97
|
-
|
|
98
|
-
this.dispatchEvent(
|
|
99
|
-
new CustomEvent('field-change', {
|
|
100
|
-
bubbles: true,
|
|
101
|
-
composed: true,
|
|
102
|
-
detail: {
|
|
103
|
-
before: this.value,
|
|
104
|
-
after: {
|
|
105
|
-
[idField]: selected[idField],
|
|
106
|
-
[nameField]: selected[nameField],
|
|
107
|
-
[descriptionField]: selected[descriptionField]
|
|
108
|
-
},
|
|
109
|
-
record: this.record,
|
|
110
|
-
column: this.column,
|
|
111
|
-
row: this.row
|
|
112
|
-
}
|
|
113
|
-
})
|
|
114
|
-
)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
var value = this.value || {}
|
|
118
|
-
var template =
|
|
119
|
-
this.template ||
|
|
120
|
-
html`
|
|
121
|
-
<ox-id-selector
|
|
122
|
-
.value=${value.id}
|
|
123
|
-
.confirmCallback=${confirmCallback.bind(this)}
|
|
124
|
-
.queryName=${this.column.record.options.queryName}
|
|
125
|
-
.basicArgs=${this.column.record.options.basicArgs}
|
|
126
|
-
></ox-id-selector>
|
|
127
|
-
`
|
|
128
|
-
|
|
129
|
-
this.popup = openPopup(template, {
|
|
130
|
-
backdrop: true,
|
|
131
|
-
size: 'large',
|
|
132
|
-
title: 'select item'
|
|
133
|
-
})
|
|
134
|
-
}
|
|
135
|
-
}
|
package/src/grist/index.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { registerEditor, registerRenderer } from '@operato/data-grist'
|
|
2
|
-
|
|
3
|
-
import { CodeEditor } from './code-editor'
|
|
4
|
-
import { IdInput } from './id-input.js'
|
|
5
|
-
import { IdRenderer } from './id-renderer.js'
|
|
6
|
-
import { ObjectEditor } from './object-editor'
|
|
7
|
-
|
|
8
|
-
/* register grist renderer/editor for id */
|
|
9
|
-
registerEditor('id', IdInput)
|
|
10
|
-
registerEditor('object', ObjectEditor as any)
|
|
11
|
-
registerEditor('code', CodeEditor)
|
|
12
|
-
|
|
13
|
-
registerRenderer('id', IdRenderer)
|