@operato/app 1.0.0-beta.1 → 1.0.0-beta.2

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 (24) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/src/grist-editor/ox-grist-editor-code.js +5 -8
  3. package/dist/src/grist-editor/ox-grist-editor-code.js.map +1 -1
  4. package/dist/src/grist-editor/ox-grist-editor-partition-keys.js +3 -3
  5. package/dist/src/grist-editor/ox-grist-editor-partition-keys.js.map +1 -1
  6. package/dist/src/grist-editor/ox-grist-editor-resource-id.d.ts +1 -2
  7. package/dist/src/grist-editor/ox-grist-editor-resource-id.js +9 -7
  8. package/dist/src/grist-editor/ox-grist-editor-resource-id.js.map +1 -1
  9. package/dist/src/grist-editor/ox-grist-editor-resource-object.js +17 -15
  10. package/dist/src/grist-editor/ox-grist-editor-resource-object.js.map +1 -1
  11. package/dist/src/grist-editor/ox-selector-resource-id.d.ts +3 -2
  12. package/dist/src/grist-editor/ox-selector-resource-id.js +8 -3
  13. package/dist/src/grist-editor/ox-selector-resource-id.js.map +1 -1
  14. package/dist/src/grist-editor/ox-selector-resource-object.d.ts +3 -2
  15. package/dist/src/grist-editor/ox-selector-resource-object.js +8 -3
  16. package/dist/src/grist-editor/ox-selector-resource-object.js.map +1 -1
  17. package/dist/tsconfig.tsbuildinfo +1 -1
  18. package/package.json +14 -14
  19. package/src/grist-editor/ox-grist-editor-code.ts +6 -8
  20. package/src/grist-editor/ox-grist-editor-partition-keys.ts +4 -4
  21. package/src/grist-editor/ox-grist-editor-resource-id.ts +12 -10
  22. package/src/grist-editor/ox-grist-editor-resource-object.ts +19 -17
  23. package/src/grist-editor/ox-selector-resource-id.ts +10 -4
  24. package/src/grist-editor/ox-selector-resource-object.ts +11 -5
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-beta.1",
6
+ "version": "1.0.0-beta.2",
7
7
  "main": "dist/src/index.js",
8
8
  "module": "dist/src/index.js",
9
9
  "exports": {
@@ -58,18 +58,18 @@
58
58
  "@material/mwc-button": "^0.25.3",
59
59
  "@material/mwc-icon": "^0.25.3",
60
60
  "@material/mwc-icon-button": "^0.25.3",
61
- "@operato/attachment": "^1.0.0-beta.1",
62
- "@operato/data-grist": "^1.0.0-beta.1",
63
- "@operato/font": "^1.0.0-beta.1",
64
- "@operato/form": "^1.0.0-beta.1",
65
- "@operato/graphql": "^1.0.0-beta.1",
66
- "@operato/i18n": "^1.0.0-beta.1",
67
- "@operato/input": "^1.0.0-beta.1",
68
- "@operato/layout": "^1.0.0-beta.1",
69
- "@operato/property-editor": "^1.0.0-beta.1",
70
- "@operato/shell": "^1.0.0-beta.1",
71
- "@operato/styles": "^1.0.0-beta.1",
72
- "@operato/utils": "^1.0.0-beta.1",
61
+ "@operato/attachment": "^1.0.0-beta.2",
62
+ "@operato/data-grist": "^1.0.0-beta.2",
63
+ "@operato/font": "^1.0.0-beta.2",
64
+ "@operato/form": "^1.0.0-beta.2",
65
+ "@operato/graphql": "^1.0.0-beta.2",
66
+ "@operato/i18n": "^1.0.0-beta.2",
67
+ "@operato/input": "^1.0.0-beta.2",
68
+ "@operato/layout": "^1.0.0-beta.2",
69
+ "@operato/property-editor": "^1.0.0-beta.2",
70
+ "@operato/shell": "^1.0.0-beta.2",
71
+ "@operato/styles": "^1.0.0-beta.2",
72
+ "@operato/utils": "^1.0.0-beta.2",
73
73
  "codemirror": "^5.59.1",
74
74
  "codemirror-graphql": "^0.15.2",
75
75
  "cronstrue": "^2.2.0",
@@ -110,5 +110,5 @@
110
110
  "prettier --write"
111
111
  ]
112
112
  },
113
- "gitHead": "cfa0be4c72d93b2bf3f851c09b5c62c6025edf0f"
113
+ "gitHead": "514a836d3f5e959695701ba41913aee18a1efe66"
114
114
  }
@@ -1,8 +1,9 @@
1
1
  import './ox-popup-code-input.js'
2
2
 
3
- import { OxGristEditor } from '@operato/data-grist'
4
- import { customElement } from 'lit/decorators.js'
5
3
  import { html } from 'lit'
4
+ import { customElement } from 'lit/decorators.js'
5
+
6
+ import { OxGristEditor } from '@operato/data-grist'
6
7
  import { i18next } from '@operato/i18n'
7
8
  import { openPopup } from '@operato/layout'
8
9
 
@@ -29,7 +30,7 @@ export class OxGristEditorCode extends OxGristEditor {
29
30
 
30
31
  var change = (value: string) => {
31
32
  this.dispatchEvent(
32
- new CustomEvent('change', {
33
+ new CustomEvent('field-change', {
33
34
  bubbles: true,
34
35
  composed: true,
35
36
  detail: {
@@ -48,15 +49,12 @@ export class OxGristEditorCode extends OxGristEditor {
48
49
  <ox-popup-code-input
49
50
  .value=${this.value}
50
51
  mode=${mode}
51
- @change=${(e: CustomEvent) => {
52
- change(e.detail.value)
53
- popup.close()
54
- }}
52
+ .confirmCallback=${change.bind(this)}
55
53
  ></ox-popup-code-input>
56
54
  `,
57
55
  {
58
56
  backdrop: true,
59
- title: i18next.t('title.setting schedule'),
57
+ title: i18next.t('title.edit code'),
60
58
  help: 'data-grist/grist-editor/code'
61
59
  }
62
60
  )
@@ -4,13 +4,13 @@
4
4
 
5
5
  import './ox-popup-partition-keys-input.js'
6
6
 
7
- import { PopupHandle, openPopup } from '@operato/layout'
8
- import { customElement, property } from 'lit/decorators.js'
7
+ import { html } from 'lit'
8
+ import { customElement } from 'lit/decorators.js'
9
+ import { cloneDeep } from 'lodash-es'
9
10
 
10
11
  import { OxGristEditor } from '@operato/data-grist'
11
- import { cloneDeep } from 'lodash-es'
12
- import { html } from 'lit'
13
12
  import { i18next } from '@operato/i18n'
13
+ import { openPopup, PopupHandle } from '@operato/layout'
14
14
 
15
15
  @customElement('ox-grist-editor-partition-keys')
16
16
  export class OxGristEditorPartitionKeys extends OxGristEditor {
@@ -1,12 +1,12 @@
1
1
  import '@material/mwc-icon'
2
2
  import './ox-selector-resource-id.js'
3
3
 
4
- import { GristRecord, OxGristEditor } from '@operato/data-grist'
5
- import { PopupHandle, openPopup } from '@operato/layout'
6
- import { TemplateResult, html } from 'lit'
7
-
4
+ import { html } from 'lit'
8
5
  import { customElement } from 'lit/decorators.js'
9
6
 
7
+ import { GristRecord, OxGristEditor } from '@operato/data-grist'
8
+ import { openPopup, PopupHandle } from '@operato/layout'
9
+
10
10
  @customElement('ox-input-resource-id')
11
11
  export class OxGristEditorResourceId extends OxGristEditor {
12
12
  private popup?: PopupHandle
@@ -38,7 +38,7 @@ export class OxGristEditorResourceId extends OxGristEditor {
38
38
  delete this.popup
39
39
  }
40
40
 
41
- const confirmCallback: (record: GristRecord | undefined) => void = selected => {
41
+ const confirmCallback: (record?: GristRecord) => void = selected => {
42
42
  if (!selected) {
43
43
  return
44
44
  }
@@ -51,11 +51,13 @@ export class OxGristEditorResourceId extends OxGristEditor {
51
51
  composed: true,
52
52
  detail: {
53
53
  before: this.value,
54
- after: {
55
- [idField]: selected[idField],
56
- [nameField]: selected[nameField],
57
- [descriptionField]: selected[descriptionField]
58
- },
54
+ after: selected
55
+ ? {
56
+ [idField]: selected[idField],
57
+ [nameField]: selected[nameField],
58
+ [descriptionField]: selected[descriptionField]
59
+ }
60
+ : null,
59
61
  record: this.record,
60
62
  column: this.column,
61
63
  row: this.row
@@ -1,12 +1,12 @@
1
1
  import '@material/mwc-icon'
2
2
  import './ox-selector-resource-object.js'
3
3
 
4
- import { PopupHandle, openPopup } from '@operato/layout'
5
- import { TemplateResult, css, html } from 'lit'
4
+ import { html, TemplateResult } from 'lit'
5
+ import { customElement } from 'lit/decorators.js'
6
6
 
7
7
  import { OxGristEditor } from '@operato/data-grist'
8
- import { customElement } from 'lit/decorators.js'
9
8
  import { i18next } from '@operato/i18n'
9
+ import { openPopup, PopupHandle } from '@operato/layout'
10
10
 
11
11
  @customElement('ox-grist-editor-resource-object')
12
12
  export class OxGristEditorResourceObject extends OxGristEditor {
@@ -55,7 +55,7 @@ export class OxGristEditorResourceObject extends OxGristEditor {
55
55
  delete this.popup
56
56
  }
57
57
 
58
- const confirmCallback = (selected: { [field: string]: any }) => {
58
+ const confirmCallback = (selected?: { [field: string]: any }) => {
59
59
  var { idField = 'id', nameField = 'name', descriptionField = 'description' } = this.column.record.options || {}
60
60
 
61
61
  this.dispatchEvent(
@@ -64,19 +64,21 @@ export class OxGristEditorResourceObject extends OxGristEditor {
64
64
  composed: true,
65
65
  detail: {
66
66
  before: this.value,
67
- after: {
68
- ...(this.column.record.options.select || [])
69
- .map((field: any) => field.name)
70
- .reduce((obj: { [field: string]: any }, fieldName: string) => {
71
- return (obj = {
72
- ...obj,
73
- [fieldName]: selected[fieldName]
74
- })
75
- }, {} as { [field: string]: any }),
76
- [idField]: selected[idField],
77
- [nameField]: selected[nameField],
78
- [descriptionField]: selected[descriptionField]
79
- },
67
+ after: selected
68
+ ? {
69
+ ...(this.column.record.options.select || [])
70
+ .map((field: any) => field.name)
71
+ .reduce((obj: { [field: string]: any }, fieldName: string) => {
72
+ return (obj = {
73
+ ...obj,
74
+ [fieldName]: selected[fieldName]
75
+ })
76
+ }, {} as { [field: string]: any }),
77
+ [idField]: selected[idField],
78
+ [nameField]: selected[nameField],
79
+ [descriptionField]: selected[descriptionField]
80
+ }
81
+ : null,
80
82
  record: this.record,
81
83
  column: this.column,
82
84
  row: this.row
@@ -1,11 +1,11 @@
1
1
  import '@operato/data-grist'
2
2
 
3
- import { DataGrist, FetchOption, GristData, GristRecord, ZERO_DATA } from '@operato/data-grist'
4
- import { LitElement, css, html } from 'lit'
3
+ import gql from 'graphql-tag'
4
+ import { css, html, LitElement } from 'lit'
5
5
  import { customElement, property, query } from 'lit/decorators.js'
6
6
 
7
+ import { DataGrist, FetchOption, GristData, GristRecord, ZERO_DATA } from '@operato/data-grist'
7
8
  import { client } from '@operato/graphql'
8
- import gql from 'graphql-tag'
9
9
  import { i18next } from '@operato/i18n'
10
10
  import { isMobileDevice } from '@operato/utils'
11
11
 
@@ -47,7 +47,7 @@ export class OxSelectorResourceId extends LitElement {
47
47
  @property({ type: Object }) data: GristData = ZERO_DATA
48
48
  @property({ type: String }) queryName!: string
49
49
  @property({ type: Object }) basicArgs: any
50
- @property({ type: Object }) confirmCallback?: (record: GristRecord | undefined) => void
50
+ @property({ type: Object }) confirmCallback?: (record?: GristRecord) => void
51
51
  @property({ type: Array }) selectedRecords: GristRecord[] = []
52
52
 
53
53
  @query('ox-grist') grist!: DataGrist
@@ -66,12 +66,18 @@ export class OxSelectorResourceId extends LitElement {
66
66
  </ox-grist>
67
67
 
68
68
  <div class="button-container">
69
+ <mwc-button @click=${this.onempty.bind(this)}>${i18next.t('button.empty')}</mwc-button>
69
70
  <mwc-button @click=${this.oncancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>
70
71
  <mwc-button @click=${this.onconfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>
71
72
  </div>
72
73
  `
73
74
  }
74
75
 
76
+ onempty() {
77
+ this.confirmCallback && this.confirmCallback()
78
+ history.back()
79
+ }
80
+
75
81
  oncancel() {
76
82
  history.back()
77
83
  }
@@ -1,6 +1,10 @@
1
1
  import '@operato/data-grist'
2
2
  import '@operato/form/ox-search-form.js'
3
3
 
4
+ import gql from 'graphql-tag'
5
+ import { css, html, LitElement } from 'lit'
6
+ import { customElement, property, query } from 'lit/decorators.js'
7
+
4
8
  import {
5
9
  ColumnConfig,
6
10
  DataGrist,
@@ -11,12 +15,8 @@ import {
11
15
  GristRecord,
12
16
  ZERO_DATA
13
17
  } from '@operato/data-grist'
14
- import { LitElement, css, html } from 'lit'
15
18
  import { MultiColumnFormStyles, SearchForm } from '@operato/form'
16
19
  import { buildArgs, client, gqlContext } from '@operato/graphql'
17
- import { customElement, property, query } from 'lit/decorators.js'
18
-
19
- import gql from 'graphql-tag'
20
20
  import { i18next } from '@operato/i18n'
21
21
  import { isMobileDevice } from '@operato/utils'
22
22
 
@@ -57,7 +57,7 @@ export class OxSelectorResourceObject extends LitElement {
57
57
  @property({ type: Object }) data: GristData = ZERO_DATA
58
58
  @property({ type: String }) queryName!: string
59
59
  @property({ type: Object }) basicArgs: any
60
- @property({ type: Object }) confirmCallback?: (record: GristRecord | undefined) => void
60
+ @property({ type: Object }) confirmCallback?: (record?: GristRecord | null) => void
61
61
  @property({ type: Array }) selectedRecords: GristRecord[] = []
62
62
 
63
63
  @property({ type: Array }) searchFields: any
@@ -99,12 +99,18 @@ export class OxSelectorResourceObject extends LitElement {
99
99
  ></ox-grist>
100
100
 
101
101
  <div class="button-container">
102
+ <mwc-button @click=${this.onempty.bind(this)}>${i18next.t('button.empty')}</mwc-button>
102
103
  <mwc-button @click=${this.oncancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>
103
104
  <mwc-button @click=${this.onconfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>
104
105
  </div>
105
106
  `
106
107
  }
107
108
 
109
+ onempty() {
110
+ this.confirmCallback && this.confirmCallback()
111
+ history.back()
112
+ }
113
+
108
114
  oncancel() {
109
115
  history.back()
110
116
  }