@operato/app 1.0.0-beta.7 → 1.0.0
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/CHANGELOG.md +377 -0
- package/demo/data-grist-test.html +1 -1
- package/dist/src/filters-form/filter-resource-select.d.ts +4 -0
- package/dist/src/filters-form/filter-resource-select.js +78 -0
- package/dist/src/filters-form/filter-resource-select.js.map +1 -0
- package/dist/src/filters-form/index.d.ts +1 -0
- package/dist/src/filters-form/index.js +5 -0
- package/dist/src/filters-form/index.js.map +1 -0
- package/dist/src/grist-editor/index.js +1 -9
- package/dist/src/grist-editor/index.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-editor-resource-object.d.ts +0 -1
- package/dist/src/grist-editor/ox-grist-editor-resource-object.js +7 -12
- package/dist/src/grist-editor/ox-grist-editor-resource-object.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-renderer-crontab.js +3 -3
- package/dist/src/grist-editor/ox-grist-renderer-crontab.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-renderer-resource-id.js +5 -2
- package/dist/src/grist-editor/ox-grist-renderer-resource-id.js.map +1 -1
- package/dist/src/grist-editor/ox-popup-code-input.js +5 -4
- package/dist/src/grist-editor/ox-popup-code-input.js.map +1 -1
- package/dist/src/grist-editor/ox-selector-resource-id.js +4 -3
- package/dist/src/grist-editor/ox-selector-resource-id.js.map +1 -1
- package/dist/src/grist-editor/ox-selector-resource-object.js +5 -3
- package/dist/src/grist-editor/ox-selector-resource-object.js.map +1 -1
- package/dist/src/input/ox-input-background-pattern.d.ts +3 -0
- package/dist/src/input/ox-input-background-pattern.js +35 -7
- package/dist/src/input/ox-input-background-pattern.js.map +1 -1
- package/dist/src/input/ox-input-fill-style.d.ts +4 -2
- package/dist/src/input/ox-input-fill-style.js +13 -7
- package/dist/src/input/ox-input-fill-style.js.map +1 -1
- package/dist/src/input/ox-input-graphql.d.ts +1 -1
- package/dist/src/input/ox-input-graphql.js +7 -7
- package/dist/src/input/ox-input-graphql.js.map +1 -1
- package/dist/src/property-editor/index.d.ts +2 -1
- package/dist/src/property-editor/index.js +5 -2
- package/dist/src/property-editor/index.js.map +1 -1
- package/dist/src/property-editor/ox-property-editor-graphql.d.ts +2 -2
- package/dist/src/property-editor/ox-property-editor-graphql.js +4 -4
- package/dist/src/property-editor/ox-property-editor-graphql.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +24 -30
- package/src/filters-form/filter-resource-select.ts +94 -0
- package/src/filters-form/index.ts +6 -0
- package/src/grist-editor/index.ts +1 -9
- package/src/grist-editor/ox-grist-editor-resource-object.ts +17 -13
- package/src/grist-editor/ox-grist-renderer-crontab.ts +5 -4
- package/src/grist-editor/ox-grist-renderer-resource-id.ts +6 -2
- package/src/grist-editor/ox-popup-code-input.ts +5 -4
- package/src/grist-editor/ox-selector-resource-id.ts +4 -3
- package/src/grist-editor/ox-selector-resource-object.ts +5 -3
- package/src/input/ox-input-background-pattern.ts +37 -7
- package/src/input/ox-input-fill-style.ts +18 -8
- package/src/input/ox-input-graphql.ts +8 -8
- package/src/property-editor/index.ts +5 -2
- package/src/property-editor/ox-property-editor-graphql.ts +5 -4
- package/dist/src/grist-editor/ox-grist-editor-crontab.d.ts +0 -8
- package/dist/src/grist-editor/ox-grist-editor-crontab.js +0 -50
- package/dist/src/grist-editor/ox-grist-editor-crontab.js.map +0 -1
- package/dist/src/grist-editor/ox-grist-editor-parameters.d.ts +0 -12
- package/dist/src/grist-editor/ox-grist-editor-parameters.js +0 -84
- package/dist/src/grist-editor/ox-grist-editor-parameters.js.map +0 -1
- package/dist/src/grist-editor/ox-grist-editor-partition-keys.d.ts +0 -11
- package/dist/src/grist-editor/ox-grist-editor-partition-keys.js +0 -74
- package/dist/src/grist-editor/ox-grist-editor-partition-keys.js.map +0 -1
- package/dist/src/grist-editor/ox-grist-editor-value-map.d.ts +0 -11
- package/dist/src/grist-editor/ox-grist-editor-value-map.js +0 -74
- package/dist/src/grist-editor/ox-grist-editor-value-map.js.map +0 -1
- package/dist/src/grist-editor/ox-parameters-builder.d.ts +0 -4
- package/dist/src/grist-editor/ox-parameters-builder.js +0 -118
- package/dist/src/grist-editor/ox-parameters-builder.js.map +0 -1
- package/dist/src/grist-editor/ox-popup-crontab-input.d.ts +0 -11
- package/dist/src/grist-editor/ox-popup-crontab-input.js +0 -74
- package/dist/src/grist-editor/ox-popup-crontab-input.js.map +0 -1
- package/dist/src/grist-editor/ox-popup-parameters-builder.d.ts +0 -13
- package/dist/src/grist-editor/ox-popup-parameters-builder.js +0 -111
- package/dist/src/grist-editor/ox-popup-parameters-builder.js.map +0 -1
- package/dist/src/grist-editor/ox-popup-partition-keys-input.d.ts +0 -12
- package/dist/src/grist-editor/ox-popup-partition-keys-input.js +0 -98
- package/dist/src/grist-editor/ox-popup-partition-keys-input.js.map +0 -1
- package/dist/src/grist-editor/ox-popup-value-map-input.d.ts +0 -12
- package/dist/src/grist-editor/ox-popup-value-map-input.js +0 -104
- package/dist/src/grist-editor/ox-popup-value-map-input.js.map +0 -1
- package/src/grist-editor/ox-grist-editor-crontab.ts +0 -62
- package/src/grist-editor/ox-grist-editor-parameters.ts +0 -99
- package/src/grist-editor/ox-grist-editor-partition-keys.ts +0 -86
- package/src/grist-editor/ox-grist-editor-value-map.ts +0 -86
- package/src/grist-editor/ox-parameters-builder.ts +0 -128
- package/src/grist-editor/ox-popup-crontab-input.ts +0 -74
- package/src/grist-editor/ox-popup-parameters-builder.ts +0 -106
- package/src/grist-editor/ox-popup-partition-keys-input.ts +0 -95
- package/src/grist-editor/ox-popup-value-map-input.ts +0 -101
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
|
|
6
|
+
"version": "1.0.0",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"module": "dist/src/index.js",
|
|
9
9
|
"exports": {
|
|
@@ -20,15 +20,11 @@
|
|
|
20
20
|
"./grist-editor/ox-grist-renderer-resource-id.js": "./dist/src/grist-editor/ox-grist-renderer-resource-id.js",
|
|
21
21
|
"./grist-editor/ox-selector-resource-object.js": "./dist/src/grist-editor/ox-selector-resource-object.js",
|
|
22
22
|
"./grist-editor/ox-grist-renderer-resource-object.js": "./dist/src/grist-editor/ox-grist-renderer-resource-object.js",
|
|
23
|
-
"./grist-editor/ox-grist-editor-crontab.js": "./dist/src/grist-editor/ox-grist-editor-crontab.js",
|
|
24
23
|
"./grist-editor/ox-grist-renderer-crontab.js": "./dist/src/grist-editor/ox-grist-renderer-crontab.js",
|
|
25
24
|
"./grist-editor/ox-grist-editor-json.js": "./dist/src/grist-editor/ox-grist-editor-json.js",
|
|
26
25
|
"./grist-editor/ox-grist-editor-code.js": "./dist/src/grist-editor/ox-grist-editor-code.js",
|
|
27
26
|
"./grist-editor/ox-grist-editor-resource-object.js": "./dist/src/grist-editor/ox-grist-editor-resource-object.js",
|
|
28
27
|
"./grist-editor/ox-grist-editor-resource-code.js": "./dist/src/grist-editor/ox-grist-editor-resource-code.js",
|
|
29
|
-
"./grist-editor/ox-grist-editor-parameters.js": "./dist/src/grist-editor/ox-grist-editor-parameters.js",
|
|
30
|
-
"./grist-editor/ox-grist-editor-value-map.js": "./dist/src/grist-editor/ox-grist-editor-value-map.js",
|
|
31
|
-
"./grist-editor/ox-grist-editor-partition-keys.js": "./dist/src/grist-editor/ox-grist-editor-partition-keys.js",
|
|
32
28
|
"./filter-renderer.js": "./dist/src/filter-renderer/index.js"
|
|
33
29
|
},
|
|
34
30
|
"publishConfig": {
|
|
@@ -53,31 +49,29 @@
|
|
|
53
49
|
"storybook:build": "tsc && npm run analyze -- --exclude dist && build-storybook"
|
|
54
50
|
},
|
|
55
51
|
"dependencies": {
|
|
56
|
-
"@graphql-tools/
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"@material/mwc-button": "^0.
|
|
60
|
-
"@
|
|
61
|
-
"@
|
|
62
|
-
"@operato/
|
|
63
|
-
"@operato/
|
|
64
|
-
"@operato/
|
|
65
|
-
"@operato/
|
|
66
|
-
"@operato/
|
|
67
|
-
"@operato/
|
|
68
|
-
"@operato/
|
|
69
|
-
"@operato/
|
|
70
|
-
"@operato/
|
|
71
|
-
"@operato/
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"codemirror": "^5.59.1",
|
|
75
|
-
"codemirror-graphql": "^0.15.2",
|
|
52
|
+
"@graphql-tools/wrap": "^8.5.0",
|
|
53
|
+
"@material/mwc-button": "^0.26.1",
|
|
54
|
+
"@material/mwc-icon": "^0.26.1",
|
|
55
|
+
"@material/mwc-icon-button": "^0.26.1",
|
|
56
|
+
"@operato/attachment": "^1.0.0",
|
|
57
|
+
"@operato/data-grist": "^1.0.0",
|
|
58
|
+
"@operato/font": "^1.0.0",
|
|
59
|
+
"@operato/form": "^1.0.0",
|
|
60
|
+
"@operato/graphql": "^1.0.0",
|
|
61
|
+
"@operato/i18n": "^1.0.0",
|
|
62
|
+
"@operato/input": "^1.0.0",
|
|
63
|
+
"@operato/layout": "^1.0.0",
|
|
64
|
+
"@operato/property-editor": "^1.0.0",
|
|
65
|
+
"@operato/shell": "^1.0.0",
|
|
66
|
+
"@operato/styles": "^1.0.0",
|
|
67
|
+
"@operato/utils": "^1.0.0",
|
|
68
|
+
"codemirror": "^5.64.0",
|
|
69
|
+
"codemirror-graphql": "^1.3.2",
|
|
76
70
|
"cronstrue": "^2.2.0",
|
|
77
71
|
"cross-fetch": "^3.1.5",
|
|
78
|
-
"graphql": "^
|
|
72
|
+
"graphql": "^16.5.0",
|
|
79
73
|
"graphql-tag": "^2.12.6",
|
|
80
|
-
"lit": "^2.2.
|
|
74
|
+
"lit": "^2.2.7"
|
|
81
75
|
},
|
|
82
76
|
"devDependencies": {
|
|
83
77
|
"@custom-elements-manifest/analyzer": "^0.4.17",
|
|
@@ -87,12 +81,12 @@
|
|
|
87
81
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
88
82
|
"@typescript-eslint/parser": "^4.33.0",
|
|
89
83
|
"@web/dev-server": "^0.1.29",
|
|
90
|
-
"@web/dev-server-storybook": "
|
|
84
|
+
"@web/dev-server-storybook": "^0.5.0",
|
|
91
85
|
"@web/test-runner": "next",
|
|
92
86
|
"concurrently": "^5.3.0",
|
|
93
87
|
"eslint": "^7.32.0",
|
|
94
88
|
"eslint-config-prettier": "^8.3.0",
|
|
95
|
-
"husky": "^
|
|
89
|
+
"husky": "^7.0.2",
|
|
96
90
|
"lint-staged": "^10.5.4",
|
|
97
91
|
"prettier": "^2.4.1",
|
|
98
92
|
"tslib": "^2.3.1",
|
|
@@ -111,5 +105,5 @@
|
|
|
111
105
|
"prettier --write"
|
|
112
106
|
]
|
|
113
107
|
},
|
|
114
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "c383e4b11cb4195f32be9b0daa4342dda0bbb2ab"
|
|
115
109
|
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import '@operato/input/ox-checkbox.js'
|
|
2
|
+
import '../grist-editor/ox-selector-resource-id'
|
|
3
|
+
|
|
4
|
+
import { html } from 'lit-html'
|
|
5
|
+
|
|
6
|
+
import { FilterConfig, FilterSelectRenderer } from '@operato/form'
|
|
7
|
+
import { i18next } from '@operato/i18n'
|
|
8
|
+
import { openPopup } from '@operato/layout'
|
|
9
|
+
|
|
10
|
+
type SelectedCallback = (value: { id: string; name: string; description: string }) => void
|
|
11
|
+
|
|
12
|
+
function openResourceSelector(filter: FilterConfig, value: any, confirmCallback: SelectedCallback) {
|
|
13
|
+
const { queryName, select, list, basicArgs, valueField = 'id' } = filter.options || {}
|
|
14
|
+
|
|
15
|
+
var actualValue
|
|
16
|
+
if (typeof valueField === 'function') {
|
|
17
|
+
actualValue = valueField(value)
|
|
18
|
+
} else {
|
|
19
|
+
actualValue = value?.[valueField]
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var template = html`
|
|
23
|
+
<ox-selector-resource-id
|
|
24
|
+
.value=${actualValue}
|
|
25
|
+
.confirmCallback=${confirmCallback}
|
|
26
|
+
.queryName=${queryName}
|
|
27
|
+
.select=${select}
|
|
28
|
+
.list=${list}
|
|
29
|
+
.basicArgs=${basicArgs}
|
|
30
|
+
.valueField=${valueField}
|
|
31
|
+
></ox-selector-resource-id>
|
|
32
|
+
`
|
|
33
|
+
|
|
34
|
+
const popup = openPopup(template, {
|
|
35
|
+
backdrop: true,
|
|
36
|
+
size: 'large',
|
|
37
|
+
title: i18next.t('title.select_item')
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const FilterResourceSelect: FilterSelectRenderer = (filter, value, owner) => {
|
|
42
|
+
const { name, operator = 'like' } = filter
|
|
43
|
+
|
|
44
|
+
return operator === 'like'
|
|
45
|
+
? html` <input
|
|
46
|
+
type="text"
|
|
47
|
+
name=${name}
|
|
48
|
+
.value=${value}
|
|
49
|
+
@change=${(e: CustomEvent) => {
|
|
50
|
+
const input = e.target as HTMLInputElement
|
|
51
|
+
input.dispatchEvent(
|
|
52
|
+
new CustomEvent('filter-change', {
|
|
53
|
+
bubbles: true,
|
|
54
|
+
composed: true,
|
|
55
|
+
detail: {
|
|
56
|
+
name,
|
|
57
|
+
operator,
|
|
58
|
+
value: input.value
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
)
|
|
62
|
+
}}
|
|
63
|
+
/>`
|
|
64
|
+
: operator == 'in'
|
|
65
|
+
? html``
|
|
66
|
+
: operator === 'eq'
|
|
67
|
+
? html`
|
|
68
|
+
<input
|
|
69
|
+
style="min-width: 100px; min-height: 24px"
|
|
70
|
+
type="text"
|
|
71
|
+
name=${name}
|
|
72
|
+
.value=${value}
|
|
73
|
+
readonly
|
|
74
|
+
@click=${(e: Event) => {
|
|
75
|
+
e.stopPropagation()
|
|
76
|
+
|
|
77
|
+
const confirmCallback = (selected?: { [field: string]: any }) => {
|
|
78
|
+
var { idField = 'id', nameField = 'name', descriptionField = 'description' } = filter.options || {}
|
|
79
|
+
|
|
80
|
+
owner.dispatchEvent(
|
|
81
|
+
new CustomEvent('filter-change', {
|
|
82
|
+
bubbles: true,
|
|
83
|
+
composed: true,
|
|
84
|
+
detail: selected ? selected[idField] : ''
|
|
85
|
+
})
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
openResourceSelector(filter, value, confirmCallback)
|
|
90
|
+
}}
|
|
91
|
+
/>
|
|
92
|
+
`
|
|
93
|
+
: html``
|
|
94
|
+
}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { OxGristRendererJson5, registerEditor, registerRenderer } from '@operato/data-grist'
|
|
2
2
|
|
|
3
|
-
import { OxGristEditorCrontab } from './ox-grist-editor-crontab.js'
|
|
4
3
|
import { OxGristEditorJson } from './ox-grist-editor-json.js'
|
|
5
|
-
import { OxGristEditorParameters } from './ox-grist-editor-parameters.js'
|
|
6
|
-
import { OxGristEditorPartitionKeys } from './ox-grist-editor-partition-keys.js'
|
|
7
4
|
import { OxGristEditorResourceCode } from './ox-grist-editor-resource-code.js'
|
|
8
5
|
import { OxGristEditorResourceId } from './ox-grist-editor-resource-id.js'
|
|
9
6
|
import { OxGristEditorResourceObject } from './ox-grist-editor-resource-object.js'
|
|
10
|
-
import {
|
|
11
|
-
import { OxGristRendererCrontab } from './ox-grist-renderer-crontab.js'
|
|
7
|
+
import { OxGristRendererCrontab } from './ox-grist-renderer-crontab'
|
|
12
8
|
import { OxGristRendererResourceId } from './ox-grist-renderer-resource-id.js'
|
|
13
9
|
import { OxGristRendererResourceObject } from './ox-grist-renderer-resource-object.js'
|
|
14
10
|
|
|
@@ -16,10 +12,6 @@ import { OxGristRendererResourceObject } from './ox-grist-renderer-resource-obje
|
|
|
16
12
|
registerEditor('resource-id', OxGristEditorResourceId)
|
|
17
13
|
registerEditor('resource-object', OxGristEditorResourceObject)
|
|
18
14
|
registerEditor('resource-code', OxGristEditorResourceCode)
|
|
19
|
-
registerEditor('parameters', OxGristEditorParameters)
|
|
20
|
-
registerEditor('value-map', OxGristEditorValueMap)
|
|
21
|
-
registerEditor('partition-keys', OxGristEditorPartitionKeys)
|
|
22
|
-
registerEditor('crontab', OxGristEditorCrontab)
|
|
23
15
|
registerEditor('json', OxGristEditorJson)
|
|
24
16
|
|
|
25
17
|
registerRenderer('resource-id', OxGristRendererResourceId)
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import '@material/mwc-icon'
|
|
2
1
|
import './ox-selector-resource-object.js'
|
|
3
2
|
|
|
4
3
|
import { html, TemplateResult } from 'lit'
|
|
@@ -30,10 +29,7 @@ export class OxGristEditorResourceObject extends OxGristEditor {
|
|
|
30
29
|
description = value[descriptionField] && `(${value[descriptionField]})`
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
return html`
|
|
34
|
-
${!value ? html`` : html` <span>${name || ''}${description || ''}</span> `}
|
|
35
|
-
<mwc-icon>arrow_drop_down</mwc-icon>
|
|
36
|
-
`
|
|
32
|
+
return html` ${!value ? html`` : html` <span style="flex:1">${name || ''}${description || ''}</span> `} `
|
|
37
33
|
}
|
|
38
34
|
|
|
39
35
|
async firstUpdated() {
|
|
@@ -55,9 +51,18 @@ export class OxGristEditorResourceObject extends OxGristEditor {
|
|
|
55
51
|
delete this.popup
|
|
56
52
|
}
|
|
57
53
|
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
var {
|
|
55
|
+
idField = 'id',
|
|
56
|
+
nameField = 'name',
|
|
57
|
+
descriptionField = 'description',
|
|
58
|
+
valueField = 'id',
|
|
59
|
+
queryName,
|
|
60
|
+
basicArgs,
|
|
61
|
+
select,
|
|
62
|
+
list
|
|
63
|
+
} = this.column.record.options || {}
|
|
60
64
|
|
|
65
|
+
const confirmCallback = (selected?: { [field: string]: any }) => {
|
|
61
66
|
this.dispatchEvent(
|
|
62
67
|
new CustomEvent('field-change', {
|
|
63
68
|
bubbles: true,
|
|
@@ -88,7 +93,6 @@ export class OxGristEditorResourceObject extends OxGristEditor {
|
|
|
88
93
|
}
|
|
89
94
|
|
|
90
95
|
var value = this.value || {}
|
|
91
|
-
var valueField: string | ((item: any) => any) = this.column.record.options.valueField || 'id'
|
|
92
96
|
var actualValue
|
|
93
97
|
if (typeof valueField === 'function') {
|
|
94
98
|
actualValue = valueField(value)
|
|
@@ -102,11 +106,11 @@ export class OxGristEditorResourceObject extends OxGristEditor {
|
|
|
102
106
|
<ox-selector-resource-object
|
|
103
107
|
.value=${actualValue}
|
|
104
108
|
.confirmCallback=${confirmCallback.bind(this)}
|
|
105
|
-
.queryName=${
|
|
106
|
-
.select=${
|
|
107
|
-
.list=${
|
|
108
|
-
.basicArgs=${
|
|
109
|
-
.valueField=${
|
|
109
|
+
.queryName=${queryName}
|
|
110
|
+
.select=${select}
|
|
111
|
+
.list=${list}
|
|
112
|
+
.basicArgs=${basicArgs}
|
|
113
|
+
.valueField=${valueField}
|
|
110
114
|
></ox-selector-resource-object>
|
|
111
115
|
`
|
|
112
116
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { FieldRenderer } from '@operato/data-grist'
|
|
2
1
|
import cronstrue from 'cronstrue/i18n'
|
|
3
|
-
import { detectOverflow } from '@operato/utils'
|
|
4
|
-
import { html } from 'lit'
|
|
5
2
|
import i18next from 'i18next'
|
|
3
|
+
import { html } from 'lit'
|
|
4
|
+
|
|
5
|
+
import { FieldRenderer } from '@operato/data-grist'
|
|
6
|
+
import { detectOverflow } from '@operato/utils'
|
|
6
7
|
|
|
7
8
|
function onmouseover(e: Event) {
|
|
8
9
|
const element = e.target as HTMLSpanElement
|
|
@@ -21,7 +22,7 @@ export const OxGristRendererCrontab: FieldRenderer = (value, column, record, row
|
|
|
21
22
|
|
|
22
23
|
try {
|
|
23
24
|
const language = (i18next.language || 'en').substring(0, 2)
|
|
24
|
-
text = value
|
|
25
|
+
text = !value ? '' : cronstrue.toString(value, { locale: language || 'en' })
|
|
25
26
|
} catch (e) {
|
|
26
27
|
console.error(e)
|
|
27
28
|
}
|
|
@@ -7,7 +7,11 @@ export const OxGristRendererResourceId: FieldRenderer = (value, column, record,
|
|
|
7
7
|
return ''
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const { nameField = 'name', descriptionField = 'description' } = column.record.options || {}
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const name = value[nameField] || ''
|
|
13
|
+
const description = value[descriptionField] || ''
|
|
14
|
+
const suffix = description ? `(${description})` : ''
|
|
15
|
+
|
|
16
|
+
return html`<span>${name}${suffix}</span> `
|
|
13
17
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import '@operato/input/ox-input-code.js'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { css, html, LitElement } from 'lit'
|
|
4
4
|
import { customElement, property } from 'lit/decorators.js'
|
|
5
5
|
|
|
6
|
-
import { ScrollbarStyles } from '@operato/styles'
|
|
7
6
|
import { i18next } from '@operato/i18n'
|
|
7
|
+
import { closePopup } from '@operato/popup'
|
|
8
|
+
import { ScrollbarStyles } from '@operato/styles'
|
|
8
9
|
|
|
9
10
|
@customElement('ox-popup-code-input')
|
|
10
11
|
export class OxPopupCodeInput extends LitElement {
|
|
@@ -55,11 +56,11 @@ export class OxPopupCodeInput extends LitElement {
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
private onCancel(e: Event) {
|
|
58
|
-
|
|
59
|
+
closePopup(this)
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
private onConfirm(e: Event) {
|
|
62
63
|
this.confirmCallback && this.confirmCallback(this.value)
|
|
63
|
-
|
|
64
|
+
closePopup(this)
|
|
64
65
|
}
|
|
65
66
|
}
|
|
@@ -7,6 +7,7 @@ import { customElement, property, query } from 'lit/decorators.js'
|
|
|
7
7
|
import { DataGrist, FetchOption, GristData, GristRecord, ZERO_DATA } from '@operato/data-grist'
|
|
8
8
|
import { client } from '@operato/graphql'
|
|
9
9
|
import { i18next } from '@operato/i18n'
|
|
10
|
+
import { closePopup } from '@operato/popup'
|
|
10
11
|
import { isMobileDevice } from '@operato/utils'
|
|
11
12
|
|
|
12
13
|
@customElement('ox-selector-resource-id')
|
|
@@ -75,16 +76,16 @@ export class OxSelectorResourceId extends LitElement {
|
|
|
75
76
|
|
|
76
77
|
onempty() {
|
|
77
78
|
this.confirmCallback && this.confirmCallback()
|
|
78
|
-
|
|
79
|
+
closePopup(this)
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
oncancel() {
|
|
82
|
-
|
|
83
|
+
closePopup(this)
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
onconfirm() {
|
|
86
87
|
this.confirmCallback && this.confirmCallback(this.selected)
|
|
87
|
-
|
|
88
|
+
closePopup(this)
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
async firstUpdated() {
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
import { MultiColumnFormStyles, SearchForm } from '@operato/form'
|
|
19
19
|
import { buildArgs, client, gqlContext } from '@operato/graphql'
|
|
20
20
|
import { i18next } from '@operato/i18n'
|
|
21
|
+
import { closePopup } from '@operato/popup'
|
|
21
22
|
import { isMobileDevice } from '@operato/utils'
|
|
22
23
|
|
|
23
24
|
@customElement('ox-selector-resource-object')
|
|
@@ -88,6 +89,7 @@ export class OxSelectorResourceObject extends LitElement {
|
|
|
88
89
|
}}
|
|
89
90
|
@submit=${(e: SubmitEvent) => this.grist.fetch()}
|
|
90
91
|
.fields=${this.searchFields}
|
|
92
|
+
autofocus
|
|
91
93
|
></ox-search-form>
|
|
92
94
|
|
|
93
95
|
<ox-grist
|
|
@@ -108,16 +110,16 @@ export class OxSelectorResourceObject extends LitElement {
|
|
|
108
110
|
|
|
109
111
|
onempty() {
|
|
110
112
|
this.confirmCallback && this.confirmCallback()
|
|
111
|
-
|
|
113
|
+
closePopup(this)
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
oncancel() {
|
|
115
|
-
|
|
117
|
+
closePopup(this)
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
onconfirm() {
|
|
119
121
|
this.confirmCallback && this.confirmCallback(this.selected)
|
|
120
|
-
|
|
122
|
+
closePopup(this)
|
|
121
123
|
}
|
|
122
124
|
|
|
123
125
|
fetchHandler: FetchHandler = async ({ filters, page, limit, sorters = [] }) => {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import '@operato/i18n/ox-i18n.js'
|
|
6
|
+
import '@operato/input/ox-input-color.js'
|
|
6
7
|
import '@operato/attachment/ox-attachment-selector.js'
|
|
7
8
|
|
|
8
9
|
import { css, html } from 'lit'
|
|
@@ -12,12 +13,14 @@ import { OxFormField } from '@operato/input'
|
|
|
12
13
|
|
|
13
14
|
export type BackgroundPatternOption = {
|
|
14
15
|
image?: HTMLImageElement | string
|
|
16
|
+
color?: string
|
|
15
17
|
align?: 'left-top' | 'top' | 'right-top' | 'left' | 'center' | 'right' | 'left-bottom' | 'bottom' | 'right-bottom'
|
|
16
18
|
offsetX?: number
|
|
17
19
|
offsetY?: number
|
|
18
20
|
width?: number
|
|
19
21
|
height?: number
|
|
20
22
|
fitPattern?: boolean
|
|
23
|
+
noRepeat?: boolean
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
/**
|
|
@@ -89,6 +92,23 @@ export class OxInputBackgroundPattern extends OxFormField {
|
|
|
89
92
|
grid-column: span 2;
|
|
90
93
|
text-align: right;
|
|
91
94
|
}
|
|
95
|
+
|
|
96
|
+
.grid-10 > .icon-only-label {
|
|
97
|
+
grid-column: span 2;
|
|
98
|
+
|
|
99
|
+
background: var(--url-icon-properties-label) no-repeat;
|
|
100
|
+
float: left;
|
|
101
|
+
margin: 0;
|
|
102
|
+
align-self: stretch;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.icon-only-label.color {
|
|
106
|
+
background-position: 100% -500px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.grid-10 > ox-input-color {
|
|
110
|
+
grid-column: span 8;
|
|
111
|
+
}
|
|
92
112
|
`
|
|
93
113
|
|
|
94
114
|
@property({ type: Object }) value?: BackgroundPatternOption
|
|
@@ -112,13 +132,13 @@ export class OxInputBackgroundPattern extends OxFormField {
|
|
|
112
132
|
|
|
113
133
|
<select value-key="align" class="select-content" .value=${value.align}>
|
|
114
134
|
<option value="left-top">Left Top</option>
|
|
115
|
-
<option value="top">Top</option>
|
|
135
|
+
<option value="top">Center Top</option>
|
|
116
136
|
<option value="right-top">Right Top</option>
|
|
117
|
-
<option value="left">Left</option>
|
|
118
|
-
<option value="center">Center</option>
|
|
119
|
-
<option value="right">Right</option>
|
|
137
|
+
<option value="left">Left Center</option>
|
|
138
|
+
<option value="center">Center Center</option>
|
|
139
|
+
<option value="right">Right Center</option>
|
|
120
140
|
<option value="left-bottom">Left Bottom</option>
|
|
121
|
-
<option value="bottom">Bottom</option>
|
|
141
|
+
<option value="bottom">Center Bottom</option>
|
|
122
142
|
<option value="right-bottom">Right Bottom</option>
|
|
123
143
|
</select>
|
|
124
144
|
|
|
@@ -136,9 +156,19 @@ export class OxInputBackgroundPattern extends OxFormField {
|
|
|
136
156
|
<input type="number" value-key="height" .value=${value.height} />
|
|
137
157
|
</div>
|
|
138
158
|
|
|
159
|
+
<div class="grid-10">
|
|
160
|
+
<label class="icon-only-label color"></label>
|
|
161
|
+
<ox-input-color value-key="color" .value=${value.color}> </ox-input-color>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
139
164
|
<div class="grid-10">
|
|
140
165
|
<input value-key="fitPattern" type="checkbox" .checked=${value.fitPattern} required />
|
|
141
|
-
<label> <ox-i18n msgid="label.fit" auto="">
|
|
166
|
+
<label> <ox-i18n msgid="label.fit" auto="">fit</ox-i18n> </label>
|
|
167
|
+
</div>
|
|
168
|
+
|
|
169
|
+
<div class="grid-10">
|
|
170
|
+
<input value-key="noRepeat" type="checkbox" .checked=${value.noRepeat} required />
|
|
171
|
+
<label> <ox-i18n msgid="label.no-repeat" auto="">no repeat</ox-i18n> </label>
|
|
142
172
|
</div>
|
|
143
173
|
`
|
|
144
174
|
}
|
|
@@ -152,7 +182,7 @@ export class OxInputBackgroundPattern extends OxFormField {
|
|
|
152
182
|
var key = element.getAttribute('value-key')
|
|
153
183
|
var value: any = element.value
|
|
154
184
|
|
|
155
|
-
if (key
|
|
185
|
+
if (key === 'fitPattern' || key === 'noRepeat') {
|
|
156
186
|
value = element.checked
|
|
157
187
|
}
|
|
158
188
|
|
|
@@ -8,10 +8,12 @@ import '@operato/input/ox-input-color-stops.js'
|
|
|
8
8
|
import '@operato/input/ox-input-color-gradient.js'
|
|
9
9
|
import './ox-input-background-pattern.js'
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { css, html, PropertyValues } from 'lit'
|
|
12
|
+
import { customElement, property } from 'lit/decorators.js'
|
|
13
|
+
|
|
12
14
|
import { ColorStop, GradientOption, OxFormField, OxInputColorGradient } from '@operato/input'
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
+
|
|
16
|
+
import { BackgroundPatternOption, OxInputBackgroundPattern } from './ox-input-background-pattern.js'
|
|
15
17
|
|
|
16
18
|
export type FillStyle =
|
|
17
19
|
| {
|
|
@@ -27,6 +29,8 @@ export type FillStyle =
|
|
|
27
29
|
height?: number
|
|
28
30
|
align?: 'left-top' | 'top' | 'right-top' | 'left' | 'center' | 'right' | 'left-bottom' | 'bottom' | 'right-bottom'
|
|
29
31
|
fitPattern?: boolean
|
|
32
|
+
noRepeat?: boolean
|
|
33
|
+
color?: string
|
|
30
34
|
}
|
|
31
35
|
| 'no'
|
|
32
36
|
| string
|
|
@@ -66,13 +70,13 @@ export class OxInputColorStyle extends OxFormField {
|
|
|
66
70
|
.grid-10 > .icon-only-label {
|
|
67
71
|
grid-column: span 1;
|
|
68
72
|
|
|
69
|
-
background: url
|
|
73
|
+
background: var(--url-icon-properties-label) no-repeat;
|
|
70
74
|
float: left;
|
|
71
75
|
margin: 0;
|
|
72
76
|
}
|
|
73
77
|
|
|
74
78
|
.icon-only-label.color {
|
|
75
|
-
background-position:
|
|
79
|
+
background-position: 100% -500px;
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
[editors] > :not([active]) {
|
|
@@ -206,7 +210,9 @@ export class OxInputColorStyle extends OxFormField {
|
|
|
206
210
|
width: Number(value.width),
|
|
207
211
|
height: Number(value.height),
|
|
208
212
|
align: value.align,
|
|
209
|
-
fitPattern: value.fitPattern
|
|
213
|
+
fitPattern: value.fitPattern,
|
|
214
|
+
noRepeat: value.noRepeat,
|
|
215
|
+
color: value.color
|
|
210
216
|
}
|
|
211
217
|
|
|
212
218
|
if (!this._block_reset) {
|
|
@@ -275,7 +281,9 @@ export class OxInputColorStyle extends OxFormField {
|
|
|
275
281
|
width: Number(this.pattern.width),
|
|
276
282
|
height: Number(this.pattern.height),
|
|
277
283
|
align: this.pattern.align,
|
|
278
|
-
fitPattern: this.pattern.fitPattern
|
|
284
|
+
fitPattern: this.pattern.fitPattern,
|
|
285
|
+
noRepeat: this.pattern.noRepeat,
|
|
286
|
+
color: this.pattern.color
|
|
279
287
|
}
|
|
280
288
|
break
|
|
281
289
|
|
|
@@ -350,7 +358,9 @@ export class OxInputColorStyle extends OxFormField {
|
|
|
350
358
|
width: Number(this.pattern?.width),
|
|
351
359
|
height: Number(this.pattern?.height),
|
|
352
360
|
align: this.pattern?.align,
|
|
353
|
-
fitPattern: this.pattern?.fitPattern
|
|
361
|
+
fitPattern: this.pattern?.fitPattern,
|
|
362
|
+
noRepeat: this.pattern?.noRepeat,
|
|
363
|
+
color: this.pattern?.color
|
|
354
364
|
}
|
|
355
365
|
|
|
356
366
|
this._block_reset = true
|
|
@@ -10,19 +10,19 @@ import 'codemirror-graphql/hint'
|
|
|
10
10
|
import 'codemirror-graphql/lint'
|
|
11
11
|
import 'codemirror-graphql/mode'
|
|
12
12
|
|
|
13
|
-
import { GRAPHQL_URI, client } from '@operato/graphql'
|
|
14
|
-
import { LitElement, PropertyValues, css, html, unsafeCSS } from 'lit'
|
|
15
|
-
import { customElement, property, query } from 'lit/decorators.js'
|
|
16
|
-
import { introspectSchema, wrapSchema } from '@graphql-tools/wrap'
|
|
17
|
-
|
|
18
|
-
import CodeMirror from 'codemirror'
|
|
19
|
-
import CodeMirrorStyle from '!!text-loader!codemirror/lib/codemirror.css'
|
|
20
13
|
import FullScreenStyle from '!!text-loader!codemirror/addon/display/fullscreen.css'
|
|
14
|
+
import ShowHintStyle from '!!text-loader!codemirror/addon/hint/show-hint.css'
|
|
21
15
|
import LintStyle from '!!text-loader!codemirror/addon/lint/lint.css'
|
|
16
|
+
import CodeMirrorStyle from '!!text-loader!codemirror/lib/codemirror.css'
|
|
22
17
|
import NightThemeStyle from '!!text-loader!codemirror/theme/night.css'
|
|
23
|
-
import
|
|
18
|
+
import CodeMirror from 'codemirror'
|
|
24
19
|
import { fetch } from 'cross-fetch'
|
|
25
20
|
import { print } from 'graphql'
|
|
21
|
+
import { css, html, LitElement, PropertyValues, unsafeCSS } from 'lit'
|
|
22
|
+
import { customElement, property, query } from 'lit/decorators.js'
|
|
23
|
+
|
|
24
|
+
import { introspectSchema, wrapSchema } from '@graphql-tools/wrap'
|
|
25
|
+
import { GRAPHQL_URI } from '@operato/graphql'
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
WEB Component for code-mirror graphql editor.
|
|
@@ -13,9 +13,10 @@ import '@operato/property-editor/ox-property-editor-color.js'
|
|
|
13
13
|
import '@operato/property-editor/ox-property-editor-multiple-colors.js'
|
|
14
14
|
import '@operato/property-editor/ox-property-editor-solid-colorstops.js'
|
|
15
15
|
import '@operato/property-editor/ox-property-editor-gradient-colorstops.js'
|
|
16
|
-
import '@operato/property-editor/ox-property-editor-gradient-colorstops.js'
|
|
17
16
|
import '@operato/property-editor/ox-property-editor-textarea.js'
|
|
18
17
|
import '@operato/property-editor/ox-property-editor-table.js'
|
|
18
|
+
import '@operato/property-editor/ox-property-editor-key-values.js'
|
|
19
|
+
import '@operato/property-editor/ox-property-editor-partition-keys.js'
|
|
19
20
|
import '@operato/property-editor/ox-property-editor-value-map.js'
|
|
20
21
|
import '@operato/property-editor/ox-property-editor-value-ranges.js'
|
|
21
22
|
import '@operato/attachment/ox-property-editor-attachment-selector.js'
|
|
@@ -55,5 +56,7 @@ OxPropertyEditor.register({
|
|
|
55
56
|
graphql: 'ox-property-editor-graphql',
|
|
56
57
|
'editor-table': 'ox-property-editor-table',
|
|
57
58
|
'id-input': 'ox-property-editor-scene-component-id',
|
|
58
|
-
'font-selector': 'ox-property-editor-font-selector'
|
|
59
|
+
'font-selector': 'ox-property-editor-font-selector',
|
|
60
|
+
'partition-keys': 'ox-property-editor-partion-keys',
|
|
61
|
+
'key-values': 'ox-property-editor-key-values'
|
|
59
62
|
})
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import '../input/ox-input-graphql.js'
|
|
2
2
|
|
|
3
|
-
import { OxPropertyEditor } from '@operato/property-editor'
|
|
4
|
-
import { customElement } from 'lit/decorators.js'
|
|
5
3
|
import { html } from 'lit'
|
|
4
|
+
import { customElement } from 'lit/decorators.js'
|
|
5
|
+
|
|
6
|
+
import { OxPropertyEditor, PropertySpec } from '@operato/property-editor'
|
|
6
7
|
|
|
7
8
|
@customElement('ox-property-editor-graphql')
|
|
8
9
|
export class OxPropertyEditorGraphQL extends OxPropertyEditor {
|
|
9
|
-
editorTemplate() {
|
|
10
|
-
return html` <ox-input-graphql id="editor" .value=${
|
|
10
|
+
editorTemplate(value: any, spec: PropertySpec) {
|
|
11
|
+
return html` <ox-input-graphql id="editor" .value=${value} fullwidth> </ox-input-graphql> `
|
|
11
12
|
}
|
|
12
13
|
}
|