@operato/app 1.0.0-alpha.30 → 1.0.0-alpha.33

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 (49) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/src/grist-editor/index.js +6 -4
  3. package/dist/src/grist-editor/index.js.map +1 -1
  4. package/dist/src/grist-editor/ox-grist-editor-code.d.ts +2 -2
  5. package/dist/src/grist-editor/ox-grist-editor-code.js +2 -2
  6. package/dist/src/grist-editor/ox-grist-editor-code.js.map +1 -1
  7. package/dist/src/grist-editor/ox-grist-editor-crontab.d.ts +2 -2
  8. package/dist/src/grist-editor/ox-grist-editor-crontab.js +2 -2
  9. package/dist/src/grist-editor/ox-grist-editor-crontab.js.map +1 -1
  10. package/dist/src/grist-editor/ox-grist-editor-json.d.ts +2 -2
  11. package/dist/src/grist-editor/ox-grist-editor-json.js +2 -2
  12. package/dist/src/grist-editor/ox-grist-editor-json.js.map +1 -1
  13. package/dist/src/grist-editor/ox-grist-editor-parameters.d.ts +2 -2
  14. package/dist/src/grist-editor/ox-grist-editor-parameters.js +2 -2
  15. package/dist/src/grist-editor/ox-grist-editor-parameters.js.map +1 -1
  16. package/dist/src/grist-editor/ox-grist-editor-partition-keys.d.ts +2 -2
  17. package/dist/src/grist-editor/ox-grist-editor-partition-keys.js +2 -2
  18. package/dist/src/grist-editor/ox-grist-editor-partition-keys.js.map +1 -1
  19. package/dist/src/grist-editor/ox-grist-editor-resource-code.d.ts +2 -2
  20. package/dist/src/grist-editor/ox-grist-editor-resource-code.js +2 -2
  21. package/dist/src/grist-editor/ox-grist-editor-resource-code.js.map +1 -1
  22. package/dist/src/grist-editor/ox-grist-editor-resource-id.d.ts +2 -2
  23. package/dist/src/grist-editor/ox-grist-editor-resource-id.js +2 -2
  24. package/dist/src/grist-editor/ox-grist-editor-resource-id.js.map +1 -1
  25. package/dist/src/grist-editor/ox-grist-editor-resource-object.d.ts +2 -2
  26. package/dist/src/grist-editor/ox-grist-editor-resource-object.js +2 -2
  27. package/dist/src/grist-editor/ox-grist-editor-resource-object.js.map +1 -1
  28. package/dist/src/grist-editor/ox-grist-editor-value-map.d.ts +2 -2
  29. package/dist/src/grist-editor/ox-grist-editor-value-map.js +2 -2
  30. package/dist/src/grist-editor/ox-grist-editor-value-map.js.map +1 -1
  31. package/dist/src/grist-editor/ox-grist-renderer-resource-object.d.ts +2 -0
  32. package/dist/src/grist-editor/ox-grist-renderer-resource-object.js +22 -0
  33. package/dist/src/grist-editor/ox-grist-renderer-resource-object.js.map +1 -0
  34. package/dist/src/grist-editor/ox-popup-partition-keys-input.js +1 -1
  35. package/dist/src/grist-editor/ox-popup-partition-keys-input.js.map +1 -1
  36. package/dist/tsconfig.tsbuildinfo +1 -1
  37. package/package.json +16 -15
  38. package/src/grist-editor/index.ts +6 -4
  39. package/src/grist-editor/ox-grist-editor-code.ts +2 -2
  40. package/src/grist-editor/ox-grist-editor-crontab.ts +2 -2
  41. package/src/grist-editor/ox-grist-editor-json.ts +2 -2
  42. package/src/grist-editor/ox-grist-editor-parameters.ts +2 -2
  43. package/src/grist-editor/ox-grist-editor-partition-keys.ts +2 -2
  44. package/src/grist-editor/ox-grist-editor-resource-code.ts +2 -2
  45. package/src/grist-editor/ox-grist-editor-resource-id.ts +2 -2
  46. package/src/grist-editor/ox-grist-editor-resource-object.ts +2 -2
  47. package/src/grist-editor/ox-grist-editor-value-map.ts +2 -2
  48. package/src/grist-editor/ox-grist-renderer-resource-object.ts +25 -0
  49. 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.30",
6
+ "version": "1.0.0-alpha.33",
7
7
  "main": "dist/src/index.js",
8
8
  "module": "dist/src/index.js",
9
9
  "exports": {
@@ -17,8 +17,9 @@
17
17
  "./grist-editor.js": "./dist/src/grist-editor/index.js",
18
18
  "./grist-editor/ox-grist-editor-resource-id.js": "./dist/src/grist-editor/ox-grist-editor-resource-id.js",
19
19
  "./grist-editor/ox-selector-resource-id.js": "./dist/src/grist-editor/ox-selector-resource-id.js",
20
- "./grist-editor/ox-renderer-resource-id.js": "./dist/src/grist-editor/ox-renderer-resource-id.js",
20
+ "./grist-editor/ox-grist-renderer-resource-id.js": "./dist/src/grist-editor/ox-grist-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-grist-renderer-resource-object.js": "./dist/src/grist-editor/ox-grist-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.30",
60
- "@operato/data-grist": "^1.0.0-alpha.30",
61
- "@operato/font": "^1.0.0-alpha.30",
62
- "@operato/form": "^1.0.0-alpha.30",
63
- "@operato/graphql": "^1.0.0-alpha.30",
64
- "@operato/i18n": "^1.0.0-alpha.30",
65
- "@operato/input": "^1.0.0-alpha.30",
66
- "@operato/layout": "^1.0.0-alpha.30",
67
- "@operato/property-editor": "^1.0.0-alpha.30",
68
- "@operato/shell": "^1.0.0-alpha.30",
69
- "@operato/styles": "^1.0.0-alpha.30",
70
- "@operato/utils": "^1.0.0-alpha.30",
60
+ "@operato/attachment": "^1.0.0-alpha.33",
61
+ "@operato/data-grist": "^1.0.0-alpha.33",
62
+ "@operato/font": "^1.0.0-alpha.33",
63
+ "@operato/form": "^1.0.0-alpha.33",
64
+ "@operato/graphql": "^1.0.0-alpha.33",
65
+ "@operato/i18n": "^1.0.0-alpha.33",
66
+ "@operato/input": "^1.0.0-alpha.33",
67
+ "@operato/layout": "^1.0.0-alpha.33",
68
+ "@operato/property-editor": "^1.0.0-alpha.33",
69
+ "@operato/shell": "^1.0.0-alpha.33",
70
+ "@operato/styles": "^1.0.0-alpha.33",
71
+ "@operato/utils": "^1.0.0-alpha.33",
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": "1c34587861ba435ec33a5eba542c88608f8ea6d3"
111
+ "gitHead": "0a92fdc92e904a69ed5f6dfbfb0f383c4d54f102"
111
112
  }
@@ -1,4 +1,4 @@
1
- import { Json5Renderer, registerEditor, registerRenderer } from '@operato/data-grist'
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('parameters', Json5Renderer)
25
- registerRenderer('value-map', Json5Renderer)
26
- registerRenderer('partition-keys', Json5Renderer)
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 { InputEditor } from '@operato/data-grist'
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 InputEditor {
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 { InputEditor } from '@operato/data-grist'
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 InputEditor {
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 { InputEditor } from '@operato/data-grist'
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 InputEditor {
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, InputEditor } from '@operato/data-grist'
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 InputEditor {
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 { InputEditor } from '@operato/data-grist'
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 InputEditor {
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 { InputEditor, RecordConfig } from '@operato/data-grist'
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 InputEditor {
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, InputEditor } from '@operato/data-grist'
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 InputEditor {
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 { InputEditor } from '@operato/data-grist'
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 InputEditor {
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, InputEditor } from '@operato/data-grist'
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 InputEditor {
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
+ }
@@ -73,7 +73,7 @@ export class OxPopupPartitionKeysInput extends LitElement {
73
73
  이런 이유로, Object.assign(...)을 사용하였다.
74
74
  */
75
75
 
76
- if (!this.value) {
76
+ if (!this.value || typeof this.value !== 'object') {
77
77
  this.value = {}
78
78
  }
79
79