@operato/app 1.0.1 → 1.0.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.
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.1",
6
+ "version": "1.0.2",
7
7
  "main": "dist/src/index.js",
8
8
  "module": "dist/src/index.js",
9
9
  "exports": {
@@ -106,5 +106,5 @@
106
106
  "prettier --write"
107
107
  ]
108
108
  },
109
- "gitHead": "4518c7ee134a20627d81d0a41e071e4b50cf173d"
109
+ "gitHead": "dcd7b17f0019192e7c052bcf524acc2902e16367"
110
110
  }
@@ -59,9 +59,13 @@ export class OxGristEditorResourceObject extends OxGristEditor {
59
59
  queryName,
60
60
  basicArgs,
61
61
  select,
62
+ columns,
62
63
  list
63
64
  } = this.column.record.options || {}
64
65
 
66
+ /* select options is only for compatability, it might be able to be deprecated. */
67
+ columns = columns || select
68
+
65
69
  const confirmCallback = (selected?: { [field: string]: any }) => {
66
70
  this.dispatchEvent(
67
71
  new CustomEvent('field-change', {
@@ -71,7 +75,7 @@ export class OxGristEditorResourceObject extends OxGristEditor {
71
75
  before: this.value,
72
76
  after: selected
73
77
  ? {
74
- ...(this.column.record.options.select || [])
78
+ ...(columns || [])
75
79
  .map((field: any) => field.name)
76
80
  .reduce((obj: { [field: string]: any }, fieldName: string) => {
77
81
  return (obj = {
@@ -107,7 +111,7 @@ export class OxGristEditorResourceObject extends OxGristEditor {
107
111
  .value=${actualValue}
108
112
  .confirmCallback=${confirmCallback.bind(this)}
109
113
  .queryName=${queryName}
110
- .select=${select}
114
+ .columns=${columns}
111
115
  .list=${list}
112
116
  .basicArgs=${basicArgs}
113
117
  .valueField=${valueField}
@@ -54,13 +54,12 @@ export class OxSelectorResourceObject extends LitElement {
54
54
  @property({ type: Array }) selectedRecords: GristRecord[] = []
55
55
 
56
56
  @property({ type: Array }) searchFields: any
57
- @property({ type: Array }) select: {
57
+ @property({ type: Array }) columns: {
58
58
  type: string
59
59
  name: string
60
60
  header: string
61
61
  subFields?: string[]
62
62
  hidden: boolean
63
- ignoreCondition: boolean
64
63
  queryName: string
65
64
  width: number
66
65
  }[] = []
@@ -115,7 +114,7 @@ export class OxSelectorResourceObject extends LitElement {
115
114
  query: gql`
116
115
  query($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
117
116
  fetch: ${this.queryName} (filters: $filters, pagination: $pagination, sortings: $sortings) {
118
- ${this.getSelectFields()}
117
+ ${this.getQueryFields()}
119
118
  }
120
119
  }
121
120
  `,
@@ -180,7 +179,7 @@ export class OxSelectorResourceObject extends LitElement {
180
179
  }
181
180
  }
182
181
 
183
- const select = this.select || [
182
+ const columns = this.columns || [
184
183
  {
185
184
  type: 'string',
186
185
  name: 'id',
@@ -215,7 +214,7 @@ export class OxSelectorResourceObject extends LitElement {
215
214
  ...this.config,
216
215
  columns: [
217
216
  ...this.config.columns,
218
- ...select.map(selectField => {
217
+ ...columns.map(selectField => {
219
218
  return {
220
219
  ...selectField,
221
220
  type: selectField.type || 'string',
@@ -227,10 +226,10 @@ export class OxSelectorResourceObject extends LitElement {
227
226
  }
228
227
  }
229
228
 
230
- getSelectFields() {
231
- if (this.select && this.select.length > 0) {
229
+ getQueryFields() {
230
+ if (this.columns && this.columns.length > 0) {
232
231
  return `items {
233
- ${this.select.map(selectField => {
232
+ ${this.columns.map(selectField => {
234
233
  return selectField.type === 'object'
235
234
  ? `${selectField.name} { ${
236
235
  selectField.subFields && selectField.subFields.length > 0