@things-factory/resource-ui 7.0.1-alpha.26 → 7.0.1-alpha.27
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.
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { MultiColumnFormStyles } from '@things-factory/form-ui'
|
|
2
1
|
import '@operato/data-grist'
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
import { css, html, LitElement } from 'lit'
|
|
4
|
+
import gql from 'graphql-tag'
|
|
5
|
+
|
|
6
|
+
import { i18next } from '@operato/i18n-base'
|
|
7
|
+
import { MultiColumnFormStyles } from '@operato/form'
|
|
8
|
+
import { ButtonContainerStyles } from '@operato/styles'
|
|
9
|
+
|
|
4
10
|
import { client, gqlContext } from '@things-factory/shell'
|
|
5
11
|
import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
|
|
6
|
-
import gql from 'graphql-tag'
|
|
7
|
-
import { css, html, LitElement } from 'lit'
|
|
8
12
|
|
|
9
13
|
export class ObjectSelector extends LitElement {
|
|
10
14
|
static get properties() {
|
|
@@ -25,6 +29,7 @@ export class ObjectSelector extends LitElement {
|
|
|
25
29
|
|
|
26
30
|
static get styles() {
|
|
27
31
|
return [
|
|
32
|
+
ButtonContainerStyles,
|
|
28
33
|
MultiColumnFormStyles,
|
|
29
34
|
css`
|
|
30
35
|
:host {
|
|
@@ -38,11 +43,6 @@ export class ObjectSelector extends LitElement {
|
|
|
38
43
|
flex: 1;
|
|
39
44
|
}
|
|
40
45
|
|
|
41
|
-
.button-container {
|
|
42
|
-
display: flex;
|
|
43
|
-
margin-left: auto;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
46
|
form {
|
|
47
47
|
position: relative;
|
|
48
48
|
}
|
|
@@ -77,8 +77,8 @@ export class ObjectSelector extends LitElement {
|
|
|
77
77
|
></ox-grist>
|
|
78
78
|
|
|
79
79
|
<div class="button-container">
|
|
80
|
-
<
|
|
81
|
-
<
|
|
80
|
+
<button @click=${this.oncancel.bind(this)}><md-icon>cancel</md-icon>${i18next.t('button.cancel')}</button>
|
|
81
|
+
<button @click=${this.onconfirm.bind(this)}><md-icon>check</md-icon>${i18next.t('button.confirm')}</button>
|
|
82
82
|
</div>
|
|
83
83
|
`
|
|
84
84
|
}
|
|
@@ -179,21 +179,9 @@ export class ObjectSelector extends LitElement {
|
|
|
179
179
|
return {
|
|
180
180
|
label: selectField.header || i18next.t(`field.${selectField.name}`),
|
|
181
181
|
name: selectField.name,
|
|
182
|
-
type:
|
|
183
|
-
fieldType === 'string'
|
|
184
|
-
? 'text'
|
|
185
|
-
: numberTypes.indexOf(fieldType) >= 0
|
|
186
|
-
? 'number'
|
|
187
|
-
: fieldType === 'boolean'
|
|
188
|
-
? 'checkbox'
|
|
189
|
-
: fieldType,
|
|
182
|
+
type: fieldType === 'string' ? 'text' : numberTypes.indexOf(fieldType) >= 0 ? 'number' : fieldType === 'boolean' ? 'checkbox' : fieldType,
|
|
190
183
|
queryName: selectField.queryName,
|
|
191
|
-
props:
|
|
192
|
-
fieldType === 'string'
|
|
193
|
-
? { searchOper: 'i_like' }
|
|
194
|
-
: fieldType === 'object'
|
|
195
|
-
? { searchOper: 'in' }
|
|
196
|
-
: { searchOper: 'eq' },
|
|
184
|
+
props: fieldType === 'string' ? { searchOper: 'i_like' } : fieldType === 'object' ? { searchOper: 'in' } : { searchOper: 'eq' },
|
|
197
185
|
attrs: fieldType === 'boolean' ? ['indeterminated'] : []
|
|
198
186
|
}
|
|
199
187
|
})
|
|
@@ -284,11 +272,7 @@ export class ObjectSelector extends LitElement {
|
|
|
284
272
|
return `items {
|
|
285
273
|
${this.select.map(selectField => {
|
|
286
274
|
return selectField.type === 'object'
|
|
287
|
-
? `${selectField.name} { ${
|
|
288
|
-
selectField.subFields && selectField.subFields.length > 0
|
|
289
|
-
? selectField.subFields.join(' ')
|
|
290
|
-
: `id name description`
|
|
291
|
-
} }`
|
|
275
|
+
? `${selectField.name} { ${selectField.subFields && selectField.subFields.length > 0 ? selectField.subFields.join(' ') : `id name description`} }`
|
|
292
276
|
: `${selectField.name}`
|
|
293
277
|
})}
|
|
294
278
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/resource-ui",
|
|
3
|
-
"version": "7.0.1-alpha.
|
|
3
|
+
"version": "7.0.1-alpha.27",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@operato/app": "^2.0.0-alpha.0",
|
|
28
28
|
"@operato/data-grist": "^2.0.0-alpha.0",
|
|
29
29
|
"@operato/layout": "^2.0.0-alpha.0",
|
|
30
|
-
"@things-factory/auth-ui": "^7.0.1-alpha.
|
|
30
|
+
"@things-factory/auth-ui": "^7.0.1-alpha.27",
|
|
31
31
|
"@things-factory/context-ui": "^7.0.1-alpha.26",
|
|
32
32
|
"@things-factory/form-ui": "^7.0.1-alpha.26",
|
|
33
33
|
"@things-factory/i18n-base": "^7.0.1-alpha.26",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"@things-factory/menu-base": "^7.0.1-alpha.26",
|
|
36
36
|
"@things-factory/resource-base": "^7.0.1-alpha.26"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "ce732afe6518f62850fc0b3499fd062e7a1eea1d"
|
|
39
39
|
}
|