@operato/app 8.0.0-alpha.9 → 8.0.0-beta.1
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 +977 -2936
- package/dist/src/filters-form/filter-resource-code.d.ts +3 -0
- package/dist/src/filters-form/filter-resource-code.js +8 -0
- package/dist/src/filters-form/filter-resource-code.js.map +1 -0
- package/dist/src/filters-form/filter-resource-object.d.ts +3 -0
- package/dist/src/filters-form/filter-resource-object.js +8 -0
- package/dist/src/filters-form/filter-resource-object.js.map +1 -0
- package/dist/src/filters-form/index.js +6 -0
- package/dist/src/filters-form/index.js.map +1 -1
- package/dist/src/filters-form/ox-filter-resource-code.d.ts +17 -0
- package/dist/src/filters-form/ox-filter-resource-code.js +133 -0
- package/dist/src/filters-form/ox-filter-resource-code.js.map +1 -0
- package/dist/src/filters-form/ox-filter-resource-object.d.ts +13 -0
- package/dist/src/filters-form/ox-filter-resource-object.js +195 -0
- package/dist/src/filters-form/ox-filter-resource-object.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-editor-resource-id.js +1 -1
- package/dist/src/grist-editor/ox-grist-editor-resource-id.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +33 -22
- package/.editorconfig +0 -29
- package/.storybook/main.js +0 -3
- package/.storybook/server.mjs +0 -8
- package/src/filter-renderer/filter-resource-select.ts +0 -133
- package/src/filter-renderer/index.ts +0 -6
- package/src/filters-form/filter-resource-select.ts +0 -130
- package/src/filters-form/index.ts +0 -6
- package/src/grist-editor/index.ts +0 -26
- package/src/grist-editor/ox-grist-editor-code.ts +0 -64
- package/src/grist-editor/ox-grist-editor-json.ts +0 -64
- package/src/grist-editor/ox-grist-editor-privilege.ts +0 -58
- package/src/grist-editor/ox-grist-editor-resource-code.ts +0 -30
- package/src/grist-editor/ox-grist-editor-resource-id.ts +0 -88
- package/src/grist-editor/ox-grist-editor-resource-object-legacy.ts +0 -131
- package/src/grist-editor/ox-grist-editor-resource-object.ts +0 -156
- package/src/grist-editor/ox-grist-renderer-crontab.ts +0 -18
- package/src/grist-editor/ox-grist-renderer-resource-code.ts +0 -85
- package/src/grist-editor/ox-grist-renderer-resource-id.ts +0 -17
- package/src/grist-editor/ox-grist-renderer-resource-object.ts +0 -26
- package/src/grist-editor/ox-popup-code-input.ts +0 -69
- package/src/grist-editor/ox-popup-privilege-input.ts +0 -93
- package/src/index.ts +0 -4
- package/src/input/index.ts +0 -3
- package/src/input/ox-input-background-pattern.ts +0 -196
- package/src/input/ox-input-fill-style.ts +0 -377
- package/src/input/ox-input-graphql.ts +0 -153
- package/src/property-editor/index.ts +0 -83
- package/src/property-editor/ox-property-editor-graphql.ts +0 -22
- package/src/property-editor/ox-property-editor-resource-object.ts +0 -148
- package/src/selector/ox-selector-resource-id.ts +0 -201
- package/src/selector/ox-selector-resource-object-legacy.ts +0 -367
- package/src/selector/ox-selector-resource-object.ts +0 -300
- package/stories/graphql-client.stories.ts +0 -73
- package/stories/ox-input-graphql.stories.ts +0 -70
- package/stories/ox-selector-resource-object.stories.ts +0 -98
- package/tsconfig.json +0 -24
- package/web-dev-server.config.mjs +0 -27
- package/web-test-runner.config.mjs +0 -41
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": "8.0.0-
|
|
5
|
+
"version": "8.0.0-beta.1",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"module": "dist/src/index.js",
|
|
8
8
|
"exports": {
|
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
"./grist-editor/ox-grist-editor-resource-object.js": "./dist/src/grist-editor/ox-grist-editor-resource-object.js",
|
|
30
30
|
"./grist-editor/ox-grist-editor-resource-object-legacy.js": "./dist/src/grist-editor/ox-grist-editor-resource-object-legacy.js",
|
|
31
31
|
"./grist-editor/ox-grist-editor-resource-code.js": "./dist/src/grist-editor/ox-grist-editor-resource-code.js",
|
|
32
|
+
"./filters-form/filter-resource-code.js": "./dist/src/filters-form/filter-resource-code.js",
|
|
33
|
+
"./filters-form/filter-resource-object.js": "./dist/src/filters-form/filter-resource-object.js",
|
|
32
34
|
"./filter-renderer.js": "./dist/src/filter-renderer/index.js",
|
|
33
35
|
"./filters-form.js": "./dist/src/filters-form/index.js"
|
|
34
36
|
},
|
|
@@ -97,6 +99,15 @@
|
|
|
97
99
|
"grist-editor/ox-grist-editor-resource-code.js": [
|
|
98
100
|
"dist/src/grist-editor/ox-grist-editor-resource-code.d.ts"
|
|
99
101
|
],
|
|
102
|
+
"filters-form/filter-resource-code.js": [
|
|
103
|
+
"./dist/src/filters-form/filter-resource-code.d.ts"
|
|
104
|
+
],
|
|
105
|
+
"filters-form/filter-resource-object.js": [
|
|
106
|
+
"./dist/src/filters-form/filter-resource-object.d.ts"
|
|
107
|
+
],
|
|
108
|
+
"filters-form.js": [
|
|
109
|
+
"dist/src/filters-form/index.d.ts"
|
|
110
|
+
],
|
|
100
111
|
"filter-renderer.js": [
|
|
101
112
|
"dist/src/filter-renderer/index.d.ts"
|
|
102
113
|
]
|
|
@@ -136,18 +147,18 @@
|
|
|
136
147
|
"@graphql-tools/delegate": "^10.0.1",
|
|
137
148
|
"@graphql-tools/wrap": "^8.5.0",
|
|
138
149
|
"@material/web": "^2.0.0",
|
|
139
|
-
"@operato/attachment": "^8.0.0-
|
|
140
|
-
"@operato/data-grist": "^8.0.0-
|
|
141
|
-
"@operato/font": "^8.0.0-
|
|
142
|
-
"@operato/form": "^8.0.0-
|
|
143
|
-
"@operato/graphql": "^8.0.0-
|
|
144
|
-
"@operato/i18n": "^8.0.0-
|
|
145
|
-
"@operato/input": "^8.0.0-
|
|
146
|
-
"@operato/layout": "^8.0.0-
|
|
147
|
-
"@operato/property-editor": "^8.0.0-
|
|
148
|
-
"@operato/shell": "^8.0.0-
|
|
149
|
-
"@operato/styles": "^8.0.0-
|
|
150
|
-
"@operato/utils": "^8.0.0-
|
|
150
|
+
"@operato/attachment": "^8.0.0-beta.1",
|
|
151
|
+
"@operato/data-grist": "^8.0.0-beta.1",
|
|
152
|
+
"@operato/font": "^8.0.0-beta.1",
|
|
153
|
+
"@operato/form": "^8.0.0-beta.1",
|
|
154
|
+
"@operato/graphql": "^8.0.0-beta.1",
|
|
155
|
+
"@operato/i18n": "^8.0.0-beta.1",
|
|
156
|
+
"@operato/input": "^8.0.0-beta.1",
|
|
157
|
+
"@operato/layout": "^8.0.0-beta.1",
|
|
158
|
+
"@operato/property-editor": "^8.0.0-beta.1",
|
|
159
|
+
"@operato/shell": "^8.0.0-beta.1",
|
|
160
|
+
"@operato/styles": "^8.0.0-beta.1",
|
|
161
|
+
"@operato/utils": "^8.0.0-beta.1",
|
|
151
162
|
"cm6-graphql": "^0.0.14",
|
|
152
163
|
"codemirror": "^6.0.1",
|
|
153
164
|
"cronstrue": "^2.2.0",
|
|
@@ -157,17 +168,17 @@
|
|
|
157
168
|
"lit": "^3.1.2"
|
|
158
169
|
},
|
|
159
170
|
"devDependencies": {
|
|
160
|
-
"@custom-elements-manifest/analyzer": "^0.
|
|
171
|
+
"@custom-elements-manifest/analyzer": "^0.10.0",
|
|
161
172
|
"@hatiolab/prettier-config": "^1.0.0",
|
|
162
173
|
"@open-wc/eslint-config": "^12.0.3",
|
|
163
|
-
"@open-wc/testing": "^
|
|
164
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
165
|
-
"@typescript-eslint/parser": "^
|
|
166
|
-
"@web/dev-server": "^0.
|
|
174
|
+
"@open-wc/testing": "^4.0.0",
|
|
175
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
176
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
177
|
+
"@web/dev-server": "^0.4.0",
|
|
167
178
|
"@web/dev-server-storybook": "^2.0.1",
|
|
168
|
-
"@web/test-runner": "^0.
|
|
169
|
-
"concurrently": "^
|
|
170
|
-
"eslint": "^
|
|
179
|
+
"@web/test-runner": "^0.19.0",
|
|
180
|
+
"concurrently": "^9.0.0",
|
|
181
|
+
"eslint": "^9.0.0",
|
|
171
182
|
"eslint-config-prettier": "^9.1.0",
|
|
172
183
|
"husky": "^9.0.11",
|
|
173
184
|
"lint-staged": "^15.2.2",
|
|
@@ -188,5 +199,5 @@
|
|
|
188
199
|
"prettier --write"
|
|
189
200
|
]
|
|
190
201
|
},
|
|
191
|
-
"gitHead": "
|
|
202
|
+
"gitHead": "d5b28a2e9deb632c0dc80132f6a7196dd6fe4220"
|
|
192
203
|
}
|
package/.editorconfig
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# EditorConfig helps developers define and maintain consistent
|
|
2
|
-
# coding styles between different editors and IDEs
|
|
3
|
-
# editorconfig.org
|
|
4
|
-
|
|
5
|
-
root = true
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
[*]
|
|
9
|
-
|
|
10
|
-
# Change these settings to your own preference
|
|
11
|
-
indent_style = space
|
|
12
|
-
indent_size = 2
|
|
13
|
-
|
|
14
|
-
# We recommend you to keep these unchanged
|
|
15
|
-
end_of_line = lf
|
|
16
|
-
charset = utf-8
|
|
17
|
-
trim_trailing_whitespace = true
|
|
18
|
-
insert_final_newline = true
|
|
19
|
-
|
|
20
|
-
[*.md]
|
|
21
|
-
trim_trailing_whitespace = false
|
|
22
|
-
|
|
23
|
-
[*.json]
|
|
24
|
-
indent_size = 2
|
|
25
|
-
|
|
26
|
-
[*.{html,js,md}]
|
|
27
|
-
block_comment_start = /**
|
|
28
|
-
block_comment = *
|
|
29
|
-
block_comment_end = */
|
package/.storybook/main.js
DELETED
package/.storybook/server.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { storybookPlugin } from '@web/dev-server-storybook';
|
|
2
|
-
import baseConfig from '../web-dev-server.config.mjs';
|
|
3
|
-
|
|
4
|
-
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
|
5
|
-
...baseConfig,
|
|
6
|
-
open: '/',
|
|
7
|
-
plugins: [storybookPlugin({ type: 'web-components' }), ...baseConfig.plugins],
|
|
8
|
-
});
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import '@operato/input/ox-checkbox.js'
|
|
2
|
-
import '../selector/ox-selector-resource-id'
|
|
3
|
-
|
|
4
|
-
import { html } from 'lit-html'
|
|
5
|
-
|
|
6
|
-
import { ColumnConfig, FilterConfigObject, FilterSelectRenderer } from '@operato/data-grist'
|
|
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(column: ColumnConfig, value: any, confirmCallback: SelectedCallback) {
|
|
13
|
-
const { queryName, select, list, basicArgs, valueField = 'id', title } = column.record.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-object
|
|
24
|
-
.value=${actualValue}
|
|
25
|
-
.confirmCallback=${confirmCallback}
|
|
26
|
-
.queryName=${queryName}
|
|
27
|
-
.columns=${select}
|
|
28
|
-
.list=${list}
|
|
29
|
-
.basicArgs=${basicArgs}
|
|
30
|
-
.valueField=${valueField}
|
|
31
|
-
></ox-selector-resource-object>
|
|
32
|
-
`
|
|
33
|
-
|
|
34
|
-
const popup = openPopup(template, {
|
|
35
|
-
backdrop: true,
|
|
36
|
-
size: 'large',
|
|
37
|
-
search: {
|
|
38
|
-
autofocus: true,
|
|
39
|
-
placeholder: title || i18next.t('title.select_item'),
|
|
40
|
-
handler: (instance: any, value: any) => {
|
|
41
|
-
/* instance: template instance */
|
|
42
|
-
instance.searchText(value)
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
filter: {
|
|
46
|
-
handler: (instance: any) => {
|
|
47
|
-
/* instance: template instance */
|
|
48
|
-
instance.toggleFilter()
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export const FilterResourceSelect: FilterSelectRenderer = (column, value, owner: any) => {
|
|
55
|
-
const filter = column.filter as FilterConfigObject
|
|
56
|
-
const { operator = 'like' } = filter
|
|
57
|
-
var { idField = 'id', nameField = 'name', descriptionField = 'description' } = column.record.options || {}
|
|
58
|
-
const hideValue = value ? value[idField] : ''
|
|
59
|
-
const text = value ? value[nameField] : ''
|
|
60
|
-
|
|
61
|
-
return operator === 'like'
|
|
62
|
-
? html` <input
|
|
63
|
-
type="text"
|
|
64
|
-
name=${column.name}
|
|
65
|
-
.value=${text}
|
|
66
|
-
@change=${(e: CustomEvent) => {
|
|
67
|
-
const input = e.target as HTMLInputElement
|
|
68
|
-
input.dispatchEvent(
|
|
69
|
-
new CustomEvent('filter-change', {
|
|
70
|
-
bubbles: true,
|
|
71
|
-
composed: true,
|
|
72
|
-
detail: {
|
|
73
|
-
name: column.name,
|
|
74
|
-
operator,
|
|
75
|
-
value: input.value
|
|
76
|
-
}
|
|
77
|
-
})
|
|
78
|
-
)
|
|
79
|
-
}}
|
|
80
|
-
/>`
|
|
81
|
-
: operator == 'in'
|
|
82
|
-
? html``
|
|
83
|
-
: operator === 'eq'
|
|
84
|
-
? html`
|
|
85
|
-
<input name="${column.name}" .value=${hideValue} type="text" hidden />
|
|
86
|
-
<input
|
|
87
|
-
type="text"
|
|
88
|
-
name="${column.name}_disp"
|
|
89
|
-
.value=${text}
|
|
90
|
-
readonly
|
|
91
|
-
@click=${(e: Event) => {
|
|
92
|
-
e.stopPropagation()
|
|
93
|
-
|
|
94
|
-
const input = e.target as HTMLInputElement
|
|
95
|
-
|
|
96
|
-
const confirmCallback = (selected?: { [field: string]: any }) => {
|
|
97
|
-
let disp = selected ? selected[idField] : ''
|
|
98
|
-
|
|
99
|
-
if (selected && nameField) {
|
|
100
|
-
disp = selected[nameField]
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
input.value = disp
|
|
104
|
-
|
|
105
|
-
let codeInput =
|
|
106
|
-
owner.tagName.toLowerCase() == 'ox-grid-header'
|
|
107
|
-
? owner.renderRoot.querySelector(`[name="${column.name}"]`)
|
|
108
|
-
: owner.renderRoot.querySelector(`form [name="${column.name}"]`)
|
|
109
|
-
|
|
110
|
-
const objectValue = selected ? selected[idField] : ''
|
|
111
|
-
codeInput.value = objectValue
|
|
112
|
-
|
|
113
|
-
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
114
|
-
|
|
115
|
-
owner.dispatchEvent(
|
|
116
|
-
new CustomEvent('filter-change', {
|
|
117
|
-
bubbles: true,
|
|
118
|
-
composed: true,
|
|
119
|
-
detail: {
|
|
120
|
-
name: column.name,
|
|
121
|
-
operator,
|
|
122
|
-
value: objectValue
|
|
123
|
-
}
|
|
124
|
-
})
|
|
125
|
-
)
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
openResourceSelector(column, value, confirmCallback)
|
|
129
|
-
}}
|
|
130
|
-
/>
|
|
131
|
-
`
|
|
132
|
-
: html``
|
|
133
|
-
}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import '@operato/input/ox-checkbox.js'
|
|
2
|
-
import '../selector/ox-selector-resource-object'
|
|
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
|
-
import { GristRecord } from '@operato/data-grist'
|
|
10
|
-
|
|
11
|
-
type SelectedCallback = (value?: Partial<GristRecord>) => void
|
|
12
|
-
|
|
13
|
-
function openResourceSelector(filter: FilterConfig, value: any, confirmCallback: SelectedCallback) {
|
|
14
|
-
const { queryName, select, list, basicArgs, valueField = 'id', title } = filter.options || ({} as any)
|
|
15
|
-
|
|
16
|
-
var template = html`
|
|
17
|
-
<ox-selector-resource-object
|
|
18
|
-
.value=${value}
|
|
19
|
-
.confirmCallback=${confirmCallback}
|
|
20
|
-
.queryName=${queryName}
|
|
21
|
-
.columns=${select}
|
|
22
|
-
.list=${list}
|
|
23
|
-
.basicArgs=${basicArgs}
|
|
24
|
-
.valueField=${valueField}
|
|
25
|
-
></ox-selector-resource-object>
|
|
26
|
-
`
|
|
27
|
-
|
|
28
|
-
const popup = openPopup(template, {
|
|
29
|
-
backdrop: true,
|
|
30
|
-
size: 'large',
|
|
31
|
-
search: {
|
|
32
|
-
autofocus: true,
|
|
33
|
-
placeholder: title || i18next.t('title.select_item'),
|
|
34
|
-
handler: (instance: any, value: any) => {
|
|
35
|
-
/* instance: template instance */
|
|
36
|
-
instance.searchText(value)
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
filter: {
|
|
40
|
-
handler: (instance: any) => {
|
|
41
|
-
/* instance: template instance */
|
|
42
|
-
instance.toggleFilter()
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export const FilterResourceSelect: FilterSelectRenderer = (filter, value, owner: any) => {
|
|
49
|
-
const { name, operator = 'like' } = filter
|
|
50
|
-
var { idField = 'id', nameField = 'name', descriptionField = 'description' } = filter.options || ({} as any)
|
|
51
|
-
const hideValue = value ? value[idField] : ''
|
|
52
|
-
const text = value ? value[nameField] : ''
|
|
53
|
-
|
|
54
|
-
return operator === 'like'
|
|
55
|
-
? html` <input
|
|
56
|
-
type="text"
|
|
57
|
-
name=${name}
|
|
58
|
-
.value=${text}
|
|
59
|
-
@change=${(e: CustomEvent) => {
|
|
60
|
-
const input = e.target as HTMLInputElement
|
|
61
|
-
input.dispatchEvent(
|
|
62
|
-
new CustomEvent('filter-change', {
|
|
63
|
-
bubbles: true,
|
|
64
|
-
composed: true,
|
|
65
|
-
detail: {
|
|
66
|
-
name,
|
|
67
|
-
operator,
|
|
68
|
-
value: input.value
|
|
69
|
-
}
|
|
70
|
-
})
|
|
71
|
-
)
|
|
72
|
-
}}
|
|
73
|
-
/>`
|
|
74
|
-
: operator == 'in'
|
|
75
|
-
? html``
|
|
76
|
-
: operator === 'eq'
|
|
77
|
-
? html`
|
|
78
|
-
<input name="${name}" .value=${hideValue} type="text" hidden />
|
|
79
|
-
<input
|
|
80
|
-
type="text"
|
|
81
|
-
name="${name}_disp"
|
|
82
|
-
.value=${text}
|
|
83
|
-
readonly
|
|
84
|
-
@change=${() => false}
|
|
85
|
-
@click=${(e: Event) => {
|
|
86
|
-
e.stopPropagation()
|
|
87
|
-
|
|
88
|
-
const input = e.target as HTMLInputElement
|
|
89
|
-
const codeInput =
|
|
90
|
-
owner.tagName.toLowerCase() == 'ox-grid-header'
|
|
91
|
-
? owner.renderRoot.querySelector(`[name="${name}"]`)
|
|
92
|
-
: owner.renderRoot.querySelector(`form [name="${name}"]`)
|
|
93
|
-
|
|
94
|
-
const confirmCallback = (selected?: { [field: string]: any }) => {
|
|
95
|
-
let disp = selected ? selected[idField] : ''
|
|
96
|
-
|
|
97
|
-
if (selected && nameField) {
|
|
98
|
-
disp = selected[nameField]
|
|
99
|
-
}
|
|
100
|
-
input.value = disp
|
|
101
|
-
|
|
102
|
-
const value = selected ? selected[idField] : ''
|
|
103
|
-
codeInput.value = value
|
|
104
|
-
|
|
105
|
-
codeInput.dispatchEvent(
|
|
106
|
-
new Event('change', {
|
|
107
|
-
bubbles: true,
|
|
108
|
-
composed: true
|
|
109
|
-
})
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
owner.dispatchEvent(
|
|
113
|
-
new CustomEvent('filter-change', {
|
|
114
|
-
bubbles: true,
|
|
115
|
-
composed: true,
|
|
116
|
-
detail: {
|
|
117
|
-
name: name,
|
|
118
|
-
operator,
|
|
119
|
-
value
|
|
120
|
-
}
|
|
121
|
-
})
|
|
122
|
-
)
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
openResourceSelector(filter, codeInput.value, confirmCallback)
|
|
126
|
-
}}
|
|
127
|
-
/>
|
|
128
|
-
`
|
|
129
|
-
: html``
|
|
130
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { OxGristRendererJson5, registerEditor, registerRenderer } from '@operato/data-grist'
|
|
2
|
-
|
|
3
|
-
import { OxGristEditorJson } from './ox-grist-editor-json.js'
|
|
4
|
-
import { OxGristEditorCode } from './ox-grist-editor-code.js'
|
|
5
|
-
import { OxGristEditorResourceCode } from './ox-grist-editor-resource-code.js'
|
|
6
|
-
import { OxGristEditorResourceId } from './ox-grist-editor-resource-id.js'
|
|
7
|
-
import { OxGristEditorResourceObject } from './ox-grist-editor-resource-object.js'
|
|
8
|
-
import { OxGristRendererCrontab } from './ox-grist-renderer-crontab'
|
|
9
|
-
import { OxGristRendererResourceId } from './ox-grist-renderer-resource-id.js'
|
|
10
|
-
import { OxGristRendererResourceCode } from './ox-grist-renderer-resource-code.js'
|
|
11
|
-
import { OxGristRendererResourceObject } from './ox-grist-renderer-resource-object.js'
|
|
12
|
-
|
|
13
|
-
/* register grist renderer/editor for id */
|
|
14
|
-
registerEditor('resource-id', OxGristEditorResourceId)
|
|
15
|
-
registerEditor('resource-code', OxGristEditorResourceCode)
|
|
16
|
-
registerEditor('resource-object', OxGristEditorResourceObject)
|
|
17
|
-
registerEditor('json', OxGristEditorJson)
|
|
18
|
-
registerEditor('template', OxGristEditorCode)
|
|
19
|
-
|
|
20
|
-
registerRenderer('resource-id', OxGristRendererResourceId)
|
|
21
|
-
registerRenderer('resource-code', OxGristRendererResourceId)
|
|
22
|
-
registerRenderer('resource-object', OxGristRendererResourceObject)
|
|
23
|
-
registerRenderer('parameters', OxGristRendererJson5)
|
|
24
|
-
registerRenderer('value-map', OxGristRendererJson5)
|
|
25
|
-
registerRenderer('partition-keys', OxGristRendererJson5)
|
|
26
|
-
registerRenderer('crontab', OxGristRendererCrontab)
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import './ox-popup-code-input.js'
|
|
2
|
-
|
|
3
|
-
import { html } from 'lit'
|
|
4
|
-
import { customElement } from 'lit/decorators.js'
|
|
5
|
-
|
|
6
|
-
import { OxGristEditor } from '@operato/data-grist'
|
|
7
|
-
import { i18next } from '@operato/i18n'
|
|
8
|
-
import { openPopup } from '@operato/layout'
|
|
9
|
-
|
|
10
|
-
@customElement('ox-grist-editor-code')
|
|
11
|
-
export class OxGristEditorCode extends OxGristEditor {
|
|
12
|
-
get editorTemplate() {
|
|
13
|
-
return html` <div tabindex="0">${this.value || ''}</div> `
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
_onclick(e: Event): void {
|
|
17
|
-
e.stopPropagation()
|
|
18
|
-
this.showEditorPopup()
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
_onkeydown(e: KeyboardEvent): void {
|
|
22
|
-
const key = e.key
|
|
23
|
-
if (key == 'Enter') {
|
|
24
|
-
e.stopPropagation()
|
|
25
|
-
this.showEditorPopup()
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
showEditorPopup() {
|
|
30
|
-
var { mode, language = 'javascript' } = this.column.record?.options || {}
|
|
31
|
-
|
|
32
|
-
var change = (value: string) => {
|
|
33
|
-
this.dispatchEvent(
|
|
34
|
-
new CustomEvent('field-change', {
|
|
35
|
-
bubbles: true,
|
|
36
|
-
composed: true,
|
|
37
|
-
detail: {
|
|
38
|
-
before: this.value,
|
|
39
|
-
after: value,
|
|
40
|
-
column: this.column,
|
|
41
|
-
record: this.record,
|
|
42
|
-
row: this.row
|
|
43
|
-
}
|
|
44
|
-
})
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
var popup = openPopup(
|
|
49
|
-
html`
|
|
50
|
-
<ox-popup-code-input
|
|
51
|
-
.value=${this.value}
|
|
52
|
-
mode=${mode}
|
|
53
|
-
.confirmCallback=${change.bind(this)}
|
|
54
|
-
language=${language}
|
|
55
|
-
></ox-popup-code-input>
|
|
56
|
-
`,
|
|
57
|
-
{
|
|
58
|
-
backdrop: true,
|
|
59
|
-
title: i18next.t('title.edit code'),
|
|
60
|
-
help: 'data-grist/grist-editor/code'
|
|
61
|
-
}
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import './ox-popup-code-input.js'
|
|
2
|
-
|
|
3
|
-
import { OxGristEditor } from '@operato/data-grist'
|
|
4
|
-
import { customElement } from 'lit/decorators.js'
|
|
5
|
-
import { html } from 'lit'
|
|
6
|
-
import { i18next } from '@operato/i18n'
|
|
7
|
-
import { openPopup } from '@operato/layout'
|
|
8
|
-
|
|
9
|
-
@customElement('ox-grist-editor-json')
|
|
10
|
-
export class OxGristEditorJson extends OxGristEditor {
|
|
11
|
-
get editorTemplate() {
|
|
12
|
-
return html` <div tabindex="0">${this.value || ''}</div> `
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
_onclick(e: Event): void {
|
|
16
|
-
e.stopPropagation()
|
|
17
|
-
this.showEditorPopup()
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
_onkeydown(e: KeyboardEvent): void {
|
|
21
|
-
const key = e.key
|
|
22
|
-
if (key == 'Enter') {
|
|
23
|
-
e.stopPropagation()
|
|
24
|
-
this.showEditorPopup()
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
showEditorPopup() {
|
|
29
|
-
var change = (value: string) => {
|
|
30
|
-
this.dispatchEvent(
|
|
31
|
-
new CustomEvent('change', {
|
|
32
|
-
bubbles: true,
|
|
33
|
-
composed: true,
|
|
34
|
-
detail: {
|
|
35
|
-
before: this.value,
|
|
36
|
-
after: value,
|
|
37
|
-
column: this.column,
|
|
38
|
-
record: this.record,
|
|
39
|
-
row: this.row
|
|
40
|
-
}
|
|
41
|
-
})
|
|
42
|
-
)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
var popup = openPopup(
|
|
46
|
-
html`
|
|
47
|
-
<ox-popup-code-input
|
|
48
|
-
.value=${this.value}
|
|
49
|
-
mode="javascript"
|
|
50
|
-
@change=${(e: CustomEvent) => {
|
|
51
|
-
change(e.detail.value)
|
|
52
|
-
popup.close()
|
|
53
|
-
}}
|
|
54
|
-
lanugage="json"
|
|
55
|
-
></ox-popup-code-input>
|
|
56
|
-
`,
|
|
57
|
-
{
|
|
58
|
-
backdrop: true,
|
|
59
|
-
title: i18next.t('title.edit json'),
|
|
60
|
-
help: 'data-grist/grist-editor/json'
|
|
61
|
-
}
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import './ox-popup-privilege-input.js'
|
|
2
|
-
|
|
3
|
-
import { html } from 'lit'
|
|
4
|
-
import { customElement } from 'lit/decorators.js'
|
|
5
|
-
|
|
6
|
-
import { OxGristEditor } from '@operato/data-grist'
|
|
7
|
-
import { i18next } from '@operato/i18n'
|
|
8
|
-
import { openPopup } from '@operato/layout'
|
|
9
|
-
|
|
10
|
-
@customElement('ox-grist-editor-privilege')
|
|
11
|
-
export class OxGristEditorPrivilege extends OxGristEditor {
|
|
12
|
-
get editorTemplate() {
|
|
13
|
-
return html` <div tabindex="0">...</div> `
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
_onclick(e: Event): void {
|
|
17
|
-
e.stopPropagation()
|
|
18
|
-
this.showEditorPopup()
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
_onkeydown(e: KeyboardEvent): void {
|
|
22
|
-
const key = e.key
|
|
23
|
-
if (key == 'Enter') {
|
|
24
|
-
e.stopPropagation()
|
|
25
|
-
this.showEditorPopup()
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
showEditorPopup() {
|
|
30
|
-
var change = (value: string) => {
|
|
31
|
-
this.dispatchEvent(
|
|
32
|
-
new CustomEvent('field-change', {
|
|
33
|
-
bubbles: true,
|
|
34
|
-
composed: true,
|
|
35
|
-
detail: {
|
|
36
|
-
before: this.value,
|
|
37
|
-
after: value,
|
|
38
|
-
column: this.column,
|
|
39
|
-
record: this.record,
|
|
40
|
-
row: this.row
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
var popup = openPopup(
|
|
47
|
-
html`
|
|
48
|
-
<ox-popup-privilege-input .value=${this.value} .confirmCallback=${change.bind(this)}></ox-popup-privilege-input>
|
|
49
|
-
`,
|
|
50
|
-
{
|
|
51
|
-
backdrop: true,
|
|
52
|
-
title: i18next.t('title.edit privilege'),
|
|
53
|
-
size: 'medium',
|
|
54
|
-
help: 'data-grist/grist-editor/privilege'
|
|
55
|
-
}
|
|
56
|
-
)
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
import { OxGristEditor, RecordConfig } from '@operato/data-grist'
|
|
3
|
-
|
|
4
|
-
import { customElement } from 'lit/decorators.js'
|
|
5
|
-
import { html } from 'lit'
|
|
6
|
-
|
|
7
|
-
type CommonCodeDetail = {
|
|
8
|
-
name: string
|
|
9
|
-
description: string
|
|
10
|
-
rank: number
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@customElement('ox-grist-editor-resource-code')
|
|
14
|
-
export class OxGristEditorResourceCode extends OxGristEditor {
|
|
15
|
-
get editorTemplate() {
|
|
16
|
-
var { codes, selectDispOpt = 'code-name' } = this.column.record || {}
|
|
17
|
-
|
|
18
|
-
return html`
|
|
19
|
-
<select>
|
|
20
|
-
${(codes || []).map(
|
|
21
|
-
(code: CommonCodeDetail) => html`
|
|
22
|
-
<option ?selected=${code.name == this.value} value=${code.name}>
|
|
23
|
-
${code.name == '' ? '' : selectDispOpt.replace('name', code.description).replace('code', code.name)}
|
|
24
|
-
</option>
|
|
25
|
-
`
|
|
26
|
-
)}
|
|
27
|
-
</select>
|
|
28
|
-
`
|
|
29
|
-
}
|
|
30
|
-
}
|