@operato/app 1.1.77 → 1.1.80

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
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/app",
3
3
  "description": "WebApplication production supporting components following open-wc recommendations",
4
4
  "author": "heartyoh",
5
- "version": "1.1.77",
5
+ "version": "1.1.80",
6
6
  "main": "dist/src/index.js",
7
7
  "module": "dist/src/index.js",
8
8
  "exports": {
@@ -118,18 +118,18 @@
118
118
  "@material/mwc-button": "^0.27.0",
119
119
  "@material/mwc-icon": "^0.27.0",
120
120
  "@material/mwc-icon-button": "^0.27.0",
121
- "@operato/attachment": "^1.1.77",
122
- "@operato/data-grist": "^1.1.77",
123
- "@operato/font": "^1.1.77",
124
- "@operato/form": "^1.1.77",
125
- "@operato/graphql": "^1.1.53",
126
- "@operato/i18n": "^1.1.53",
127
- "@operato/input": "^1.1.77",
128
- "@operato/layout": "^1.1.77",
129
- "@operato/property-editor": "^1.1.77",
130
- "@operato/shell": "^1.1.77",
131
- "@operato/styles": "^1.1.77",
132
- "@operato/utils": "^1.1.66",
121
+ "@operato/attachment": "^1.1.80",
122
+ "@operato/data-grist": "^1.1.80",
123
+ "@operato/font": "^1.1.80",
124
+ "@operato/form": "^1.1.79",
125
+ "@operato/graphql": "^1.1.79",
126
+ "@operato/i18n": "^1.1.79",
127
+ "@operato/input": "^1.1.80",
128
+ "@operato/layout": "^1.1.80",
129
+ "@operato/property-editor": "^1.1.80",
130
+ "@operato/shell": "^1.1.79",
131
+ "@operato/styles": "^1.1.79",
132
+ "@operato/utils": "^1.1.79",
133
133
  "codemirror": "^5.64.0",
134
134
  "codemirror-graphql": "^1.3.2",
135
135
  "cronstrue": "^2.2.0",
@@ -170,5 +170,5 @@
170
170
  "prettier --write"
171
171
  ]
172
172
  },
173
- "gitHead": "58e6e0aa8134ef783d85f42bf4e789edc6566f87"
173
+ "gitHead": "d35d64d05d106e8039e98312414223c5b9c2cb39"
174
174
  }
@@ -60,6 +60,7 @@ export class OxGristEditorResourceObject extends OxGristEditor {
60
60
  }
61
61
 
62
62
  var {
63
+ title = '',
63
64
  idField = 'id',
64
65
  nameField = 'name',
65
66
  descriptionField = 'description',
@@ -72,6 +73,11 @@ export class OxGristEditorResourceObject extends OxGristEditor {
72
73
  list
73
74
  } = this.column.record.options || {}
74
75
 
76
+ if (!queryName) {
77
+ console.warn('queryName is empty')
78
+ return
79
+ }
80
+
75
81
  /* select options is only for compatability, it might be able to be deprecated. */
76
82
  columns = columns || select
77
83
 
@@ -131,7 +137,19 @@ export class OxGristEditorResourceObject extends OxGristEditor {
131
137
  this.popup = openPopup(template, {
132
138
  backdrop: true,
133
139
  size: 'large',
134
- title: i18next.t('title.select_item')
140
+ search: {
141
+ placeholder: title || i18next.t('title.select_item'),
142
+ handler: (instance: any, value: any) => {
143
+ /* instance: template instance */
144
+ instance.searchText(value)
145
+ }
146
+ },
147
+ filter: {
148
+ handler: (instance: any) => {
149
+ /* instance: template instance */
150
+ instance.toggleFilter()
151
+ }
152
+ }
135
153
  })
136
154
  }
137
155
  }
@@ -61,6 +61,7 @@ export class OxPropertyEditorResourceObject extends OxPropertyEditor {
61
61
  }
62
62
 
63
63
  var {
64
+ title,
64
65
  idField = 'id',
65
66
  nameField = 'name',
66
67
  descriptionField = 'description',
@@ -125,7 +126,19 @@ export class OxPropertyEditorResourceObject extends OxPropertyEditor {
125
126
  this.popup = openPopup(template, {
126
127
  backdrop: true,
127
128
  size: 'large',
128
- title: i18next.t('title.select_item')
129
+ search: {
130
+ placeholder: title || i18next.t('title.select_item'),
131
+ handler: (instance: any, value: any) => {
132
+ /* instance: template instance */
133
+ instance.searchText(value)
134
+ }
135
+ },
136
+ filter: {
137
+ handler: (instance: any) => {
138
+ /* instance: template instance */
139
+ instance.toggleFilter()
140
+ }
141
+ }
129
142
  })
130
143
  }
131
144
  }
@@ -1,7 +1,7 @@
1
1
  import '@operato/data-grist'
2
2
 
3
3
  import gql from 'graphql-tag'
4
- import { css, html, LitElement } from 'lit'
4
+ import { css, html, LitElement, PropertyValues } from 'lit'
5
5
  import { customElement, property, query } from 'lit/decorators.js'
6
6
 
7
7
  import { DataGrist, FetchHandler, GristData, GristEventHandler, GristRecord, ZERO_DATA } from '@operato/data-grist'
@@ -82,7 +82,7 @@ export class OxSelectorResourceObject extends LitElement {
82
82
  .selectedRecords=${this.selectedRecords}
83
83
  >
84
84
  <div id="filters" slot="headroom">
85
- <ox-filters-form autofocus></ox-filters-form>
85
+ <ox-filters-form autofocus without-search></ox-filters-form>
86
86
  </div>
87
87
  </ox-grist>
88
88
 
@@ -94,8 +94,16 @@ export class OxSelectorResourceObject extends LitElement {
94
94
  `
95
95
  }
96
96
 
97
+ searchText(value: string) {
98
+ this.grist.searchText = value
99
+ }
100
+
101
+ toggleFilter() {
102
+ this.grist.toggleHeadroom()
103
+ }
104
+
97
105
  onEmpty() {
98
- this.confirmCallback && this.confirmCallback()
106
+ this.confirmCallback && this.confirmCallback(null)
99
107
  closePopup(this)
100
108
  }
101
109
 
@@ -158,6 +166,7 @@ export class OxSelectorResourceObject extends LitElement {
158
166
 
159
167
  async firstUpdated() {
160
168
  const config = {
169
+ list: this.list,
161
170
  columns: [
162
171
  {
163
172
  type: 'gutter',
@@ -229,6 +238,11 @@ export class OxSelectorResourceObject extends LitElement {
229
238
  })
230
239
  ]
231
240
  }
241
+
242
+ requestAnimationFrame(() => {
243
+ /* start with hidden headroom */
244
+ this.grist.hideHeadroom()
245
+ })
232
246
  }
233
247
 
234
248
  getQueryFields() {