@operato/app 1.0.0-alpha.24 → 1.0.0-alpha.25

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/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.24",
6
+ "version": "1.0.0-alpha.25",
7
7
  "main": "dist/src/index.js",
8
8
  "module": "dist/src/index.js",
9
9
  "exports": {
@@ -21,6 +21,7 @@
21
21
  "./grist-editor/ox-selector-resource-object.js": "./dist/src/grist-editor/ox-selector-resource-object.js",
22
22
  "./grist-editor/ox-grist-editor-crontab.js": "./dist/src/grist-editor/ox-grist-editor-crontab.js",
23
23
  "./grist-editor/ox-grist-editor-json.js": "./dist/src/grist-editor/ox-grist-editor-json.js",
24
+ "./grist-editor/ox-grist-editor-code.js": "./dist/src/grist-editor/ox-grist-editor-code.js",
24
25
  "./grist-editor/ox-grist-editor-resource-object.js": "./dist/src/grist-editor/ox-grist-editor-resource-object.js",
25
26
  "./grist-editor/ox-grist-editor-resource-code.js": "./dist/src/grist-editor/ox-grist-editor-resource-code.js",
26
27
  "./grist-editor/ox-grist-editor-parameters.js": "./dist/src/grist-editor/ox-grist-editor-parameters.js",
@@ -54,18 +55,18 @@
54
55
  "@material/mwc-button": "^0.25.3",
55
56
  "@material/mwc-icon": "^0.25.3",
56
57
  "@material/mwc-icon-button": "^0.25.3",
57
- "@operato/attachment": "^1.0.0-alpha.24",
58
- "@operato/data-grist": "^1.0.0-alpha.24",
59
- "@operato/font": "^1.0.0-alpha.24",
60
- "@operato/form": "^1.0.0-alpha.24",
61
- "@operato/graphql": "^1.0.0-alpha.24",
62
- "@operato/i18n": "^1.0.0-alpha.24",
63
- "@operato/input": "^1.0.0-alpha.24",
64
- "@operato/layout": "^1.0.0-alpha.24",
65
- "@operato/property-editor": "^1.0.0-alpha.24",
66
- "@operato/shell": "^1.0.0-alpha.24",
67
- "@operato/styles": "^1.0.0-alpha.24",
68
- "@operato/utils": "^1.0.0-alpha.24",
58
+ "@operato/attachment": "^1.0.0-alpha.25",
59
+ "@operato/data-grist": "^1.0.0-alpha.25",
60
+ "@operato/font": "^1.0.0-alpha.25",
61
+ "@operato/form": "^1.0.0-alpha.25",
62
+ "@operato/graphql": "^1.0.0-alpha.25",
63
+ "@operato/i18n": "^1.0.0-alpha.25",
64
+ "@operato/input": "^1.0.0-alpha.25",
65
+ "@operato/layout": "^1.0.0-alpha.25",
66
+ "@operato/property-editor": "^1.0.0-alpha.25",
67
+ "@operato/shell": "^1.0.0-alpha.25",
68
+ "@operato/styles": "^1.0.0-alpha.25",
69
+ "@operato/utils": "^1.0.0-alpha.25",
69
70
  "codemirror": "^5.59.1",
70
71
  "codemirror-graphql": "^0.15.2",
71
72
  "cross-fetch": "^3.1.5",
@@ -105,5 +106,5 @@
105
106
  "prettier --write"
106
107
  ]
107
108
  },
108
- "gitHead": "83b1479e80639e5bc365f3dc8ad4b119a84dc31e"
109
+ "gitHead": "fa0db16f3d32ce8431f37be693ba203caefceaf9"
109
110
  }
@@ -0,0 +1,64 @@
1
+ import './ox-popup-code-input.js'
2
+
3
+ import { InputEditor } from '@operato/data-grist'
4
+ import { customElement } from 'lit/decorators.js'
5
+ import { html } from 'lit'
6
+ import { i18next } from '@operato/i18n'
7
+ import { openPopup } from '@operato/layout'
8
+
9
+ @customElement('ox-grist-editor-code')
10
+ export class OxGristEditorCode extends InputEditor {
11
+ get editorTemplate() {
12
+ return html` <input type="text" .value=${this.value || ''} /> `
13
+ }
14
+
15
+ async firstUpdated() {
16
+ await this.updateComplete
17
+
18
+ this.renderRoot.addEventListener('click', e => {
19
+ e.stopPropagation()
20
+
21
+ this.showEditorPopup()
22
+ })
23
+
24
+ this.showEditorPopup()
25
+ }
26
+
27
+ showEditorPopup() {
28
+ var { mode } = this.column.record?.options || {}
29
+
30
+ var change = (value: string) => {
31
+ this.dispatchEvent(
32
+ new CustomEvent('change', {
33
+ bubbles: true,
34
+ composed: true,
35
+ detail: {
36
+ before: this.value,
37
+ after: value,
38
+ column: this.column,
39
+ record: this.record,
40
+ row: this.row
41
+ }
42
+ })
43
+ )
44
+ }
45
+
46
+ var popup = openPopup(
47
+ html`
48
+ <ox-popup-code-input
49
+ .value=${this.value}
50
+ mode=${mode}
51
+ @change=${(e: CustomEvent) => {
52
+ change(e.detail.value)
53
+ popup.close()
54
+ }}
55
+ ></ox-popup-code-input>
56
+ `,
57
+ {
58
+ backdrop: true,
59
+ title: i18next.t('title.setting schedule'),
60
+ help: 'data-grist/grist-editor/code'
61
+ }
62
+ )
63
+ }
64
+ }
@@ -26,16 +26,6 @@ export class OxPopupCodeInput extends LitElement {
26
26
  overflow-y: auto;
27
27
  }
28
28
 
29
- span {
30
- flex: 1;
31
-
32
- display: flex;
33
- align-items: center;
34
- justify-content: center;
35
-
36
- color: var(--primary-color);
37
- }
38
-
39
29
  .button-container {
40
30
  display: flex;
41
31
  margin-left: auto;