@operato/app 1.0.0-alpha.30 → 1.0.0-alpha.31
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 +10 -0
- package/dist/src/grist-editor/index.js +6 -4
- package/dist/src/grist-editor/index.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-editor-code.d.ts +2 -2
- package/dist/src/grist-editor/ox-grist-editor-code.js +2 -2
- package/dist/src/grist-editor/ox-grist-editor-code.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-editor-crontab.d.ts +2 -2
- package/dist/src/grist-editor/ox-grist-editor-crontab.js +2 -2
- package/dist/src/grist-editor/ox-grist-editor-crontab.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-editor-json.d.ts +2 -2
- package/dist/src/grist-editor/ox-grist-editor-json.js +2 -2
- package/dist/src/grist-editor/ox-grist-editor-json.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-editor-parameters.d.ts +2 -2
- package/dist/src/grist-editor/ox-grist-editor-parameters.js +2 -2
- package/dist/src/grist-editor/ox-grist-editor-parameters.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-editor-partition-keys.d.ts +2 -2
- package/dist/src/grist-editor/ox-grist-editor-partition-keys.js +2 -2
- package/dist/src/grist-editor/ox-grist-editor-partition-keys.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-editor-resource-code.d.ts +2 -2
- package/dist/src/grist-editor/ox-grist-editor-resource-code.js +2 -2
- package/dist/src/grist-editor/ox-grist-editor-resource-code.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-editor-resource-id.d.ts +2 -2
- package/dist/src/grist-editor/ox-grist-editor-resource-id.js +2 -2
- package/dist/src/grist-editor/ox-grist-editor-resource-id.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-editor-resource-object.d.ts +2 -2
- package/dist/src/grist-editor/ox-grist-editor-resource-object.js +2 -2
- package/dist/src/grist-editor/ox-grist-editor-resource-object.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-editor-value-map.d.ts +2 -2
- package/dist/src/grist-editor/ox-grist-editor-value-map.js +2 -2
- package/dist/src/grist-editor/ox-grist-editor-value-map.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-renderer-resource-object.d.ts +2 -0
- package/dist/src/grist-editor/ox-grist-renderer-resource-object.js +22 -0
- package/dist/src/grist-editor/ox-grist-renderer-resource-object.js.map +1 -0
- package/dist/src/grist-editor/ox-popup-partition-keys-input.js +1 -1
- package/dist/src/grist-editor/ox-popup-partition-keys-input.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -14
- package/src/grist-editor/index.ts +6 -4
- package/src/grist-editor/ox-grist-editor-code.ts +2 -2
- package/src/grist-editor/ox-grist-editor-crontab.ts +2 -2
- package/src/grist-editor/ox-grist-editor-json.ts +2 -2
- package/src/grist-editor/ox-grist-editor-parameters.ts +2 -2
- package/src/grist-editor/ox-grist-editor-partition-keys.ts +2 -2
- package/src/grist-editor/ox-grist-editor-resource-code.ts +2 -2
- package/src/grist-editor/ox-grist-editor-resource-id.ts +2 -2
- package/src/grist-editor/ox-grist-editor-resource-object.ts +2 -2
- package/src/grist-editor/ox-grist-editor-value-map.ts +2 -2
- package/src/grist-editor/ox-grist-renderer-resource-object.ts +25 -0
- package/src/grist-editor/ox-popup-partition-keys-input.ts +1 -1
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "WebApplication production supporting components following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "heartyoh",
|
|
6
|
-
"version": "1.0.0-alpha.
|
|
6
|
+
"version": "1.0.0-alpha.31",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"module": "dist/src/index.js",
|
|
9
9
|
"exports": {
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"./grist-editor/ox-selector-resource-id.js": "./dist/src/grist-editor/ox-selector-resource-id.js",
|
|
20
20
|
"./grist-editor/ox-renderer-resource-id.js": "./dist/src/grist-editor/ox-renderer-resource-id.js",
|
|
21
21
|
"./grist-editor/ox-selector-resource-object.js": "./dist/src/grist-editor/ox-selector-resource-object.js",
|
|
22
|
+
"./grist-editor/ox-renderer-resource-object.js": "./dist/src/grist-editor/ox-renderer-resource-object.js",
|
|
22
23
|
"./grist-editor/ox-grist-editor-crontab.js": "./dist/src/grist-editor/ox-grist-editor-crontab.js",
|
|
23
24
|
"./grist-editor/ox-grist-editor-json.js": "./dist/src/grist-editor/ox-grist-editor-json.js",
|
|
24
25
|
"./grist-editor/ox-grist-editor-code.js": "./dist/src/grist-editor/ox-grist-editor-code.js",
|
|
@@ -56,18 +57,18 @@
|
|
|
56
57
|
"@material/mwc-button": "^0.25.3",
|
|
57
58
|
"@material/mwc-icon": "^0.25.3",
|
|
58
59
|
"@material/mwc-icon-button": "^0.25.3",
|
|
59
|
-
"@operato/attachment": "^1.0.0-alpha.
|
|
60
|
-
"@operato/data-grist": "^1.0.0-alpha.
|
|
61
|
-
"@operato/font": "^1.0.0-alpha.
|
|
62
|
-
"@operato/form": "^1.0.0-alpha.
|
|
63
|
-
"@operato/graphql": "^1.0.0-alpha.
|
|
64
|
-
"@operato/i18n": "^1.0.0-alpha.
|
|
65
|
-
"@operato/input": "^1.0.0-alpha.
|
|
66
|
-
"@operato/layout": "^1.0.0-alpha.
|
|
67
|
-
"@operato/property-editor": "^1.0.0-alpha.
|
|
68
|
-
"@operato/shell": "^1.0.0-alpha.
|
|
69
|
-
"@operato/styles": "^1.0.0-alpha.
|
|
70
|
-
"@operato/utils": "^1.0.0-alpha.
|
|
60
|
+
"@operato/attachment": "^1.0.0-alpha.31",
|
|
61
|
+
"@operato/data-grist": "^1.0.0-alpha.31",
|
|
62
|
+
"@operato/font": "^1.0.0-alpha.31",
|
|
63
|
+
"@operato/form": "^1.0.0-alpha.31",
|
|
64
|
+
"@operato/graphql": "^1.0.0-alpha.31",
|
|
65
|
+
"@operato/i18n": "^1.0.0-alpha.31",
|
|
66
|
+
"@operato/input": "^1.0.0-alpha.31",
|
|
67
|
+
"@operato/layout": "^1.0.0-alpha.31",
|
|
68
|
+
"@operato/property-editor": "^1.0.0-alpha.31",
|
|
69
|
+
"@operato/shell": "^1.0.0-alpha.31",
|
|
70
|
+
"@operato/styles": "^1.0.0-alpha.31",
|
|
71
|
+
"@operato/utils": "^1.0.0-alpha.31",
|
|
71
72
|
"codemirror": "^5.59.1",
|
|
72
73
|
"codemirror-graphql": "^0.15.2",
|
|
73
74
|
"cross-fetch": "^3.1.5",
|
|
@@ -107,5 +108,5 @@
|
|
|
107
108
|
"prettier --write"
|
|
108
109
|
]
|
|
109
110
|
},
|
|
110
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "603880e56d90c744b3a850ce4a7ca83d769f95d3"
|
|
111
112
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OxGristRendererJson5, registerEditor, registerRenderer } from '@operato/data-grist'
|
|
2
2
|
|
|
3
3
|
import { OxGristEditorCrontab } from './ox-grist-editor-crontab.js'
|
|
4
4
|
import { OxGristEditorJson } from './ox-grist-editor-json.js'
|
|
@@ -9,6 +9,7 @@ import { OxGristEditorResourceId } from './ox-grist-editor-resource-id.js'
|
|
|
9
9
|
import { OxGristEditorResourceObject } from './ox-grist-editor-resource-object.js'
|
|
10
10
|
import { OxGristEditorValueMap } from './ox-grist-editor-value-map.js'
|
|
11
11
|
import { OxGristRendererResourceId } from './ox-grist-renderer-resource-id.js'
|
|
12
|
+
import { OxGristRendererResourceObject } from './ox-grist-renderer-resource-object.js'
|
|
12
13
|
|
|
13
14
|
/* register grist renderer/editor for id */
|
|
14
15
|
registerEditor('resource-id', OxGristEditorResourceId)
|
|
@@ -21,6 +22,7 @@ registerEditor('crontab', OxGristEditorCrontab)
|
|
|
21
22
|
registerEditor('json', OxGristEditorJson)
|
|
22
23
|
|
|
23
24
|
registerRenderer('resource-id', OxGristRendererResourceId)
|
|
24
|
-
registerRenderer('
|
|
25
|
-
registerRenderer('
|
|
26
|
-
registerRenderer('
|
|
25
|
+
registerRenderer('resource-object', OxGristRendererResourceObject)
|
|
26
|
+
registerRenderer('parameters', OxGristRendererJson5)
|
|
27
|
+
registerRenderer('value-map', OxGristRendererJson5)
|
|
28
|
+
registerRenderer('partition-keys', OxGristRendererJson5)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import './ox-popup-code-input.js'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { OxGristEditor } from '@operato/data-grist'
|
|
4
4
|
import { customElement } from 'lit/decorators.js'
|
|
5
5
|
import { html } from 'lit'
|
|
6
6
|
import { i18next } from '@operato/i18n'
|
|
7
7
|
import { openPopup } from '@operato/layout'
|
|
8
8
|
|
|
9
9
|
@customElement('ox-grist-editor-code')
|
|
10
|
-
export class OxGristEditorCode extends
|
|
10
|
+
export class OxGristEditorCode extends OxGristEditor {
|
|
11
11
|
get editorTemplate() {
|
|
12
12
|
return html` <input type="text" .value=${this.value || ''} /> `
|
|
13
13
|
}
|
|
@@ -2,13 +2,13 @@ import './ox-popup-crontab-input.js'
|
|
|
2
2
|
|
|
3
3
|
import { PopupHandle, openPopup } from '@operato/layout'
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { OxGristEditor } from '@operato/data-grist'
|
|
6
6
|
import { customElement } from 'lit/decorators.js'
|
|
7
7
|
import { html } from 'lit'
|
|
8
8
|
import { i18next } from '@operato/i18n'
|
|
9
9
|
|
|
10
10
|
@customElement('ox-grist-editor-crontab')
|
|
11
|
-
export class OxGristEditorCrontab extends
|
|
11
|
+
export class OxGristEditorCrontab extends OxGristEditor {
|
|
12
12
|
private popup?: PopupHandle
|
|
13
13
|
|
|
14
14
|
get editorTemplate() {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import './ox-popup-code-input.js'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { OxGristEditor } from '@operato/data-grist'
|
|
4
4
|
import { customElement } from 'lit/decorators.js'
|
|
5
5
|
import { html } from 'lit'
|
|
6
6
|
import { i18next } from '@operato/i18n'
|
|
7
7
|
import { openPopup } from '@operato/layout'
|
|
8
8
|
|
|
9
9
|
@customElement('ox-grist-editor-json')
|
|
10
|
-
export class OxGristEditorJson extends
|
|
10
|
+
export class OxGristEditorJson extends OxGristEditor {
|
|
11
11
|
get editorTemplate() {
|
|
12
12
|
return html` <input type="text" .value=${this.value || ''} /> `
|
|
13
13
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import './ox-parameters-builder.js'
|
|
6
6
|
import './ox-popup-parameters-builder.js'
|
|
7
7
|
|
|
8
|
-
import { ColumnConfig, GristRecord,
|
|
8
|
+
import { ColumnConfig, GristRecord, OxGristEditor } from '@operato/data-grist'
|
|
9
9
|
import { PopupHandle, openPopup } from '@operato/layout'
|
|
10
10
|
import { css, html } from 'lit'
|
|
11
11
|
|
|
@@ -14,7 +14,7 @@ import { customElement } from 'lit/decorators.js'
|
|
|
14
14
|
import { i18next } from '@operato/i18n'
|
|
15
15
|
|
|
16
16
|
@customElement('ox-grist-editor-parameters')
|
|
17
|
-
export class OxGristEditorParameters extends
|
|
17
|
+
export class OxGristEditorParameters extends OxGristEditor {
|
|
18
18
|
private popup?: PopupHandle
|
|
19
19
|
|
|
20
20
|
get editorTemplate() {
|
|
@@ -7,13 +7,13 @@ import './ox-popup-partition-keys-input.js'
|
|
|
7
7
|
import { PopupHandle, openPopup } from '@operato/layout'
|
|
8
8
|
import { customElement, property } from 'lit/decorators.js'
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { OxGristEditor } from '@operato/data-grist'
|
|
11
11
|
import { cloneDeep } from 'lodash-es'
|
|
12
12
|
import { html } from 'lit'
|
|
13
13
|
import { i18next } from '@operato/i18n'
|
|
14
14
|
|
|
15
15
|
@customElement('ox-grist-editor-partition-keys')
|
|
16
|
-
export class OxGristEditorPartitionKeys extends
|
|
16
|
+
export class OxGristEditorPartitionKeys extends OxGristEditor {
|
|
17
17
|
private popup?: PopupHandle
|
|
18
18
|
|
|
19
19
|
get editorTemplate() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@material/mwc-icon'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { OxGristEditor, RecordConfig } from '@operato/data-grist'
|
|
4
4
|
import { client, gqlContext } from '@operato/graphql'
|
|
5
5
|
|
|
6
6
|
import { customElement } from 'lit/decorators.js'
|
|
@@ -32,7 +32,7 @@ const FETCH_COMMON_CODE_GQL = (codeName: string) => gql`
|
|
|
32
32
|
`
|
|
33
33
|
|
|
34
34
|
@customElement('ox-grist-editor-resource-code')
|
|
35
|
-
export class OxGristEditorResourceCode extends
|
|
35
|
+
export class OxGristEditorResourceCode extends OxGristEditor {
|
|
36
36
|
async firstUpdated() {
|
|
37
37
|
super.firstUpdated()
|
|
38
38
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import '@material/mwc-icon'
|
|
2
2
|
import './ox-selector-resource-id.js'
|
|
3
3
|
|
|
4
|
-
import { GristRecord,
|
|
4
|
+
import { GristRecord, OxGristEditor } from '@operato/data-grist'
|
|
5
5
|
import { PopupHandle, openPopup } from '@operato/layout'
|
|
6
6
|
import { TemplateResult, html } from 'lit'
|
|
7
7
|
|
|
8
8
|
import { customElement } from 'lit/decorators.js'
|
|
9
9
|
|
|
10
10
|
@customElement('ox-input-resource-id')
|
|
11
|
-
export class OxGristEditorResourceId extends
|
|
11
|
+
export class OxGristEditorResourceId extends OxGristEditor {
|
|
12
12
|
private popup?: PopupHandle
|
|
13
13
|
|
|
14
14
|
render() {
|
|
@@ -4,12 +4,12 @@ import './ox-selector-resource-object.js'
|
|
|
4
4
|
import { PopupHandle, openPopup } from '@operato/layout'
|
|
5
5
|
import { TemplateResult, css, html } from 'lit'
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { OxGristEditor } from '@operato/data-grist'
|
|
8
8
|
import { customElement } from 'lit/decorators.js'
|
|
9
9
|
import { i18next } from '@operato/i18n'
|
|
10
10
|
|
|
11
11
|
@customElement('ox-grist-editor-resource-object')
|
|
12
|
-
export class OxGristEditorResourceObject extends
|
|
12
|
+
export class OxGristEditorResourceObject extends OxGristEditor {
|
|
13
13
|
private popup?: PopupHandle
|
|
14
14
|
private template?: TemplateResult
|
|
15
15
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import './ox-popup-value-map-input.js'
|
|
6
6
|
|
|
7
|
-
import { ColumnConfig, GristRecord,
|
|
7
|
+
import { ColumnConfig, GristRecord, OxGristEditor } from '@operato/data-grist'
|
|
8
8
|
import { PopupHandle, openPopup } from '@operato/layout'
|
|
9
9
|
import { css, html } from 'lit'
|
|
10
10
|
import { customElement, property } from 'lit/decorators.js'
|
|
@@ -13,7 +13,7 @@ import { cloneDeep } from 'lodash-es'
|
|
|
13
13
|
import { i18next } from '@operato/i18n'
|
|
14
14
|
|
|
15
15
|
@customElement('ox-grist-editor-value-map')
|
|
16
|
-
export class OxGristEditorValueMap extends
|
|
16
|
+
export class OxGristEditorValueMap extends OxGristEditor {
|
|
17
17
|
private popup?: PopupHandle
|
|
18
18
|
|
|
19
19
|
get editorTemplate() {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FieldRenderer } from '@operato/data-grist'
|
|
2
|
+
import { html } from 'lit-html'
|
|
3
|
+
|
|
4
|
+
export const OxGristRendererResourceObject: FieldRenderer = (value, column, record, rowIndex, field) => {
|
|
5
|
+
if (!value) {
|
|
6
|
+
return ''
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
var { nameField = 'name', descriptionField = 'description' } = column.record.options || {}
|
|
10
|
+
var name, description
|
|
11
|
+
|
|
12
|
+
if (typeof nameField === 'function') {
|
|
13
|
+
name = nameField(value)
|
|
14
|
+
} else {
|
|
15
|
+
name = value[nameField]
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (typeof descriptionField === 'function') {
|
|
19
|
+
description = descriptionField(value)
|
|
20
|
+
} else {
|
|
21
|
+
description = value[descriptionField] && `(${value[descriptionField]})`
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return html` ${name || ''}${description || ''} `
|
|
25
|
+
}
|