@operato/app 2.0.0-alpha.9 → 2.0.0-alpha.91
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 +449 -0
- package/demo/data-grist-test.html +25 -14
- package/demo/index.html +13 -2
- package/dist/src/filters-form/filter-resource-select.js +13 -16
- package/dist/src/filters-form/filter-resource-select.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-editor-code.d.ts +1 -1
- package/dist/src/grist-editor/ox-grist-editor-json.d.ts +1 -1
- package/dist/src/grist-editor/ox-grist-editor-privilege.d.ts +1 -1
- package/dist/src/grist-editor/ox-grist-editor-resource-code.d.ts +2 -2
- package/dist/src/grist-editor/ox-grist-editor-resource-code.js +2 -2
- package/dist/src/grist-editor/ox-grist-editor-resource-code.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-editor-resource-id.d.ts +2 -2
- package/dist/src/grist-editor/ox-grist-editor-resource-id.js +2 -2
- package/dist/src/grist-editor/ox-grist-editor-resource-id.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-renderer-resource-code.d.ts +1 -1
- package/dist/src/grist-editor/ox-popup-code-input.d.ts +2 -1
- package/dist/src/grist-editor/ox-popup-code-input.js +7 -8
- package/dist/src/grist-editor/ox-popup-code-input.js.map +1 -1
- package/dist/src/grist-editor/ox-popup-privilege-input.d.ts +2 -1
- package/dist/src/grist-editor/ox-popup-privilege-input.js +8 -15
- package/dist/src/grist-editor/ox-popup-privilege-input.js.map +1 -1
- package/dist/src/input/ox-input-background-pattern.d.ts +1 -1
- package/dist/src/input/ox-input-fill-style.d.ts +1 -1
- package/dist/src/selector/ox-selector-resource-id.d.ts +2 -1
- package/dist/src/selector/ox-selector-resource-id.js +8 -9
- package/dist/src/selector/ox-selector-resource-id.js.map +1 -1
- package/dist/src/selector/ox-selector-resource-object-legacy.d.ts +2 -1
- package/dist/src/selector/ox-selector-resource-object-legacy.js +8 -9
- package/dist/src/selector/ox-selector-resource-object-legacy.js.map +1 -1
- package/dist/src/selector/ox-selector-resource-object.d.ts +3 -2
- package/dist/src/selector/ox-selector-resource-object.js +9 -10
- package/dist/src/selector/ox-selector-resource-object.js.map +1 -1
- package/dist/stories/ox-input-graphql.stories.js +13 -1
- package/dist/stories/ox-input-graphql.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +27 -29
- package/src/filters-form/filter-resource-select.ts +27 -26
- package/src/grist-editor/ox-grist-editor-resource-code.ts +2 -2
- package/src/grist-editor/ox-grist-editor-resource-id.ts +2 -2
- package/src/grist-editor/ox-popup-code-input.ts +7 -8
- package/src/grist-editor/ox-popup-privilege-input.ts +8 -15
- package/src/selector/ox-selector-resource-id.ts +8 -9
- package/src/selector/ox-selector-resource-object-legacy.ts +14 -15
- package/src/selector/ox-selector-resource-object.ts +10 -11
- package/stories/ox-input-graphql.stories.ts +13 -1
- package/themes/app-theme.css +10 -0
- package/themes/grist-theme.css +1 -1
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": "2.0.0-alpha.
|
|
5
|
+
"version": "2.0.0-alpha.91",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"module": "dist/src/index.js",
|
|
8
8
|
"exports": {
|
|
@@ -133,46 +133,44 @@
|
|
|
133
133
|
"@codemirror/view": "^6.22.1",
|
|
134
134
|
"@graphql-tools/delegate": "^10.0.1",
|
|
135
135
|
"@graphql-tools/wrap": "^8.5.0",
|
|
136
|
-
"@material/
|
|
137
|
-
"@
|
|
138
|
-
"@
|
|
139
|
-
"@operato/
|
|
140
|
-
"@operato/
|
|
141
|
-
"@operato/
|
|
142
|
-
"@operato/
|
|
143
|
-
"@operato/
|
|
144
|
-
"@operato/
|
|
145
|
-
"@operato/
|
|
146
|
-
"@operato/
|
|
147
|
-
"@operato/
|
|
148
|
-
"@operato/
|
|
149
|
-
"
|
|
150
|
-
"@operato/utils": "^2.0.0-alpha.8",
|
|
151
|
-
"cm6-graphql": "^0.0.12",
|
|
136
|
+
"@material/web": "^1.4.0",
|
|
137
|
+
"@operato/attachment": "^2.0.0-alpha.90",
|
|
138
|
+
"@operato/data-grist": "^2.0.0-alpha.90",
|
|
139
|
+
"@operato/font": "^2.0.0-alpha.90",
|
|
140
|
+
"@operato/form": "^2.0.0-alpha.91",
|
|
141
|
+
"@operato/graphql": "^2.0.0-alpha.57",
|
|
142
|
+
"@operato/i18n": "^2.0.0-alpha.59",
|
|
143
|
+
"@operato/input": "^2.0.0-alpha.90",
|
|
144
|
+
"@operato/layout": "^2.0.0-alpha.90",
|
|
145
|
+
"@operato/property-editor": "^2.0.0-alpha.90",
|
|
146
|
+
"@operato/shell": "^2.0.0-alpha.90",
|
|
147
|
+
"@operato/styles": "^2.0.0-alpha.90",
|
|
148
|
+
"@operato/utils": "^2.0.0-alpha.68",
|
|
149
|
+
"cm6-graphql": "^0.0.14",
|
|
152
150
|
"codemirror": "^6.0.1",
|
|
153
151
|
"cronstrue": "^2.2.0",
|
|
154
152
|
"cross-fetch": "^3.1.5",
|
|
155
153
|
"graphql": "^16.5.0",
|
|
156
154
|
"graphql-config": "^5.0.2",
|
|
157
155
|
"graphql-tag": "^2.12.6",
|
|
158
|
-
"lit": "^
|
|
156
|
+
"lit": "^3.1.2"
|
|
159
157
|
},
|
|
160
158
|
"devDependencies": {
|
|
161
|
-
"@custom-elements-manifest/analyzer": "^0.
|
|
159
|
+
"@custom-elements-manifest/analyzer": "^0.9.2",
|
|
162
160
|
"@hatiolab/prettier-config": "^1.0.0",
|
|
163
|
-
"@open-wc/eslint-config": "^
|
|
161
|
+
"@open-wc/eslint-config": "^12.0.3",
|
|
164
162
|
"@open-wc/testing": "^3.1.6",
|
|
165
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
166
|
-
"@typescript-eslint/parser": "^
|
|
163
|
+
"@typescript-eslint/eslint-plugin": "^7.0.1",
|
|
164
|
+
"@typescript-eslint/parser": "^7.0.1",
|
|
167
165
|
"@web/dev-server": "^0.3.0",
|
|
168
|
-
"@web/dev-server-storybook": "^0.
|
|
169
|
-
"@web/test-runner": "^0.
|
|
166
|
+
"@web/dev-server-storybook": "^2.0.1",
|
|
167
|
+
"@web/test-runner": "^0.18.0",
|
|
170
168
|
"concurrently": "^8.0.1",
|
|
171
169
|
"eslint": "^8.39.0",
|
|
172
|
-
"eslint-config-prettier": "^
|
|
173
|
-
"husky": "^
|
|
174
|
-
"lint-staged": "^
|
|
175
|
-
"prettier": "^2.
|
|
170
|
+
"eslint-config-prettier": "^9.1.0",
|
|
171
|
+
"husky": "^9.0.11",
|
|
172
|
+
"lint-staged": "^15.2.2",
|
|
173
|
+
"prettier": "^3.2.5",
|
|
176
174
|
"tslib": "^2.3.1",
|
|
177
175
|
"typescript": "^5.0.4"
|
|
178
176
|
},
|
|
@@ -189,5 +187,5 @@
|
|
|
189
187
|
"prettier --write"
|
|
190
188
|
]
|
|
191
189
|
},
|
|
192
|
-
"gitHead": "
|
|
190
|
+
"gitHead": "bd409ab29a9ea994652f9fb09489e0bad544f74a"
|
|
193
191
|
}
|
|
@@ -6,22 +6,16 @@ import { html } from 'lit-html'
|
|
|
6
6
|
import { FilterConfig, FilterSelectRenderer } from '@operato/form'
|
|
7
7
|
import { i18next } from '@operato/i18n'
|
|
8
8
|
import { openPopup } from '@operato/layout'
|
|
9
|
+
import { GristRecord } from '@operato/data-grist'
|
|
9
10
|
|
|
10
|
-
type SelectedCallback = (value
|
|
11
|
+
type SelectedCallback = (value?: Partial<GristRecord>) => void
|
|
11
12
|
|
|
12
13
|
function openResourceSelector(filter: FilterConfig, value: any, confirmCallback: SelectedCallback) {
|
|
13
14
|
const { queryName, select, list, basicArgs, valueField = 'id', title } = filter.options || {}
|
|
14
15
|
|
|
15
|
-
var actualValue
|
|
16
|
-
if (typeof valueField === 'function') {
|
|
17
|
-
actualValue = valueField(value)
|
|
18
|
-
} else {
|
|
19
|
-
actualValue = value?.[valueField]
|
|
20
|
-
}
|
|
21
|
-
|
|
22
16
|
var template = html`
|
|
23
17
|
<ox-selector-resource-object
|
|
24
|
-
.value=${
|
|
18
|
+
.value=${value}
|
|
25
19
|
.confirmCallback=${confirmCallback}
|
|
26
20
|
.queryName=${queryName}
|
|
27
21
|
.columns=${select}
|
|
@@ -53,9 +47,9 @@ function openResourceSelector(filter: FilterConfig, value: any, confirmCallback:
|
|
|
53
47
|
|
|
54
48
|
export const FilterResourceSelect: FilterSelectRenderer = (filter, value, owner: any) => {
|
|
55
49
|
const { name, operator = 'like' } = filter
|
|
56
|
-
var { idField = 'id', nameField = 'name', descriptionField = 'description' } = filter.options || {}
|
|
57
|
-
const hideValue = value ? value[idField] : ''
|
|
58
|
-
const text = value ? value[nameField] : ''
|
|
50
|
+
var { idField = 'id', nameField = 'name', descriptionField = 'description' } = filter.options || {}
|
|
51
|
+
const hideValue = value ? value[idField] : ''
|
|
52
|
+
const text = value ? value[nameField] : ''
|
|
59
53
|
|
|
60
54
|
return operator === 'like'
|
|
61
55
|
? html` <input
|
|
@@ -87,26 +81,33 @@ export const FilterResourceSelect: FilterSelectRenderer = (filter, value, owner:
|
|
|
87
81
|
name='${name}_disp'
|
|
88
82
|
.value=${text}
|
|
89
83
|
readonly
|
|
84
|
+
@change=${() => false}
|
|
90
85
|
@click=${(e: Event) => {
|
|
91
86
|
e.stopPropagation()
|
|
92
|
-
|
|
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
93
|
|
|
94
94
|
const confirmCallback = (selected?: { [field: string]: any }) => {
|
|
95
|
-
let disp = selected ? selected[idField] : ''
|
|
95
|
+
let disp = selected ? selected[idField] : ''
|
|
96
96
|
|
|
97
|
-
if(selected && nameField){
|
|
98
|
-
disp = selected[nameField]
|
|
97
|
+
if (selected && nameField) {
|
|
98
|
+
disp = selected[nameField]
|
|
99
99
|
}
|
|
100
|
-
input.value = disp
|
|
101
|
-
|
|
102
|
-
let codeInput = owner.tagName.toLowerCase() == 'ox-grid-header'
|
|
103
|
-
? owner.renderRoot.querySelector(`[name="${name}"]`)
|
|
104
|
-
: owner.renderRoot.querySelector(`form [name="${name}"]`);
|
|
100
|
+
input.value = disp
|
|
105
101
|
|
|
106
|
-
const
|
|
107
|
-
codeInput.value =
|
|
102
|
+
const value = selected ? selected[idField] : ''
|
|
103
|
+
codeInput.value = value
|
|
108
104
|
|
|
109
|
-
|
|
105
|
+
codeInput.dispatchEvent(
|
|
106
|
+
new Event('change', {
|
|
107
|
+
bubbles: true,
|
|
108
|
+
composed: true
|
|
109
|
+
})
|
|
110
|
+
)
|
|
110
111
|
|
|
111
112
|
owner.dispatchEvent(
|
|
112
113
|
new CustomEvent('filter-change', {
|
|
@@ -115,13 +116,13 @@ export const FilterResourceSelect: FilterSelectRenderer = (filter, value, owner:
|
|
|
115
116
|
detail: {
|
|
116
117
|
name: name,
|
|
117
118
|
operator,
|
|
118
|
-
value
|
|
119
|
+
value
|
|
119
120
|
}
|
|
120
121
|
})
|
|
121
122
|
)
|
|
122
123
|
}
|
|
123
124
|
|
|
124
|
-
openResourceSelector(filter, value, confirmCallback)
|
|
125
|
+
openResourceSelector(filter, codeInput.value, confirmCallback)
|
|
125
126
|
}}
|
|
126
127
|
/>
|
|
127
128
|
`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '@material/
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
2
|
import { OxGristEditor, RecordConfig } from '@operato/data-grist'
|
|
3
3
|
|
|
4
4
|
import { customElement } from 'lit/decorators.js'
|
|
@@ -20,7 +20,7 @@ export class OxGristEditorResourceCode extends OxGristEditor {
|
|
|
20
20
|
${(codes || []).map(
|
|
21
21
|
(code: CommonCodeDetail) => html`
|
|
22
22
|
<option ?selected=${code.name == this.value} value=${code.name}>
|
|
23
|
-
|
|
23
|
+
${code.name == '' ? '' : selectDispOpt.replace('name', code.description).replace('code', code.name)}
|
|
24
24
|
</option>
|
|
25
25
|
`
|
|
26
26
|
)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '@material/
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
2
|
import '../selector/ox-selector-resource-id.js'
|
|
3
3
|
|
|
4
4
|
import { html } from 'lit'
|
|
@@ -19,7 +19,7 @@ export class OxGristEditorResourceId extends OxGristEditor {
|
|
|
19
19
|
${!value
|
|
20
20
|
? html`<span tabindex="0"></span>`
|
|
21
21
|
: html` <span tabindex="0">${value[nameField]} (${value[descriptionField]})</span> `}
|
|
22
|
-
<
|
|
22
|
+
<md-icon>arrow_drop_down</md-icon>
|
|
23
23
|
`
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
1
2
|
import '@operato/input/ox-input-code.js'
|
|
2
3
|
|
|
3
4
|
import { css, html, LitElement } from 'lit'
|
|
@@ -5,11 +6,12 @@ import { customElement, property } from 'lit/decorators.js'
|
|
|
5
6
|
|
|
6
7
|
import { i18next } from '@operato/i18n'
|
|
7
8
|
import { closePopup } from '@operato/popup'
|
|
8
|
-
import { ScrollbarStyles } from '@operato/styles'
|
|
9
|
+
import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'
|
|
9
10
|
|
|
10
11
|
@customElement('ox-popup-code-input')
|
|
11
12
|
export class OxPopupCodeInput extends LitElement {
|
|
12
13
|
static styles = [
|
|
14
|
+
ButtonContainerStyles,
|
|
13
15
|
ScrollbarStyles,
|
|
14
16
|
css`
|
|
15
17
|
:host {
|
|
@@ -26,11 +28,6 @@ export class OxPopupCodeInput extends LitElement {
|
|
|
26
28
|
flex: 1;
|
|
27
29
|
overflow-y: auto;
|
|
28
30
|
}
|
|
29
|
-
|
|
30
|
-
.button-container {
|
|
31
|
-
display: flex;
|
|
32
|
-
margin-left: auto;
|
|
33
|
-
}
|
|
34
31
|
`
|
|
35
32
|
]
|
|
36
33
|
|
|
@@ -45,8 +42,10 @@ export class OxPopupCodeInput extends LitElement {
|
|
|
45
42
|
</ox-input-code>
|
|
46
43
|
|
|
47
44
|
<div class="button-container">
|
|
48
|
-
<
|
|
49
|
-
|
|
45
|
+
<button @click=${this.onCancel.bind(this)} danger>
|
|
46
|
+
<md-icon>cancel</md-icon>${i18next.t('button.cancel')}
|
|
47
|
+
</button>
|
|
48
|
+
<button @click=${this.onConfirm.bind(this)}><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
|
|
50
49
|
</div>
|
|
51
50
|
`
|
|
52
51
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
1
2
|
import '@operato/input/ox-input-privilege.js'
|
|
2
3
|
|
|
3
4
|
import gql from 'graphql-tag'
|
|
@@ -6,12 +7,13 @@ import { customElement, property, state } from 'lit/decorators.js'
|
|
|
6
7
|
|
|
7
8
|
import { i18next } from '@operato/i18n'
|
|
8
9
|
import { closePopup } from '@operato/popup'
|
|
9
|
-
import { ScrollbarStyles } from '@operato/styles'
|
|
10
|
+
import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'
|
|
10
11
|
import { client } from '@operato/graphql'
|
|
11
12
|
|
|
12
13
|
@customElement('ox-popup-privilege-input')
|
|
13
14
|
export class OxPopupPrivilegeInput extends LitElement {
|
|
14
15
|
static styles = [
|
|
16
|
+
ButtonContainerStyles,
|
|
15
17
|
ScrollbarStyles,
|
|
16
18
|
css`
|
|
17
19
|
:host {
|
|
@@ -28,15 +30,6 @@ export class OxPopupPrivilegeInput extends LitElement {
|
|
|
28
30
|
flex: 1;
|
|
29
31
|
overflow-y: auto;
|
|
30
32
|
}
|
|
31
|
-
|
|
32
|
-
.button-container {
|
|
33
|
-
display: flex;
|
|
34
|
-
flex-direction: row;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
div[padding] {
|
|
38
|
-
flex: 1;
|
|
39
|
-
}
|
|
40
33
|
`
|
|
41
34
|
]
|
|
42
35
|
|
|
@@ -51,11 +44,11 @@ export class OxPopupPrivilegeInput extends LitElement {
|
|
|
51
44
|
<ox-input-privilege .value=${this.value} .privileges=${this.privileges} @change=${this.onChange.bind(this)}>
|
|
52
45
|
</ox-input-privilege>
|
|
53
46
|
|
|
54
|
-
<div class="button-container">
|
|
55
|
-
<
|
|
56
|
-
<div
|
|
57
|
-
<
|
|
58
|
-
<
|
|
47
|
+
<div class="button-container" style="margin-left: unset;">
|
|
48
|
+
<button @click=${this.onReset.bind(this)}><md-icon>restart_alt</md-icon>${i18next.t('button.reset')}</button>
|
|
49
|
+
<div filler></div>
|
|
50
|
+
<button @click=${this.onCancel.bind(this)}><md-icon>cancel</md-icon>${i18next.t('button.cancel')}</button>
|
|
51
|
+
<button @click=${this.onConfirm.bind(this)}><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
|
|
59
52
|
</div>
|
|
60
53
|
`
|
|
61
54
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
1
2
|
import '@operato/data-grist'
|
|
2
3
|
|
|
3
4
|
import gql from 'graphql-tag'
|
|
@@ -39,11 +40,6 @@ export class OxSelectorResourceId extends LitElement {
|
|
|
39
40
|
#filters > * {
|
|
40
41
|
padding: var(--padding-default) var(--padding-wide);
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
-
.button-container {
|
|
44
|
-
display: flex;
|
|
45
|
-
margin-left: auto;
|
|
46
|
-
}
|
|
47
43
|
`
|
|
48
44
|
]
|
|
49
45
|
|
|
@@ -71,10 +67,13 @@ export class OxSelectorResourceId extends LitElement {
|
|
|
71
67
|
</div>
|
|
72
68
|
</ox-grist>
|
|
73
69
|
|
|
74
|
-
<div class="button-container">
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
|
|
70
|
+
<div class="button-container" style="margin-left: unset;">
|
|
71
|
+
<button @click=${this.onEmpty.bind(this)}>
|
|
72
|
+
<md-icon>check_box_outline_blank</md-icon>${i18next.t('button.empty')}
|
|
73
|
+
</button>
|
|
74
|
+
<div filler></div>
|
|
75
|
+
<button @click=${this.onCancel.bind(this)}><md-icon>cancel</md-icon>${i18next.t('button.cancel')}</button>
|
|
76
|
+
<button @click=${this.onConfirm.bind(this)}><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
|
|
78
77
|
</div>
|
|
79
78
|
`
|
|
80
79
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
1
2
|
import '@operato/data-grist'
|
|
2
3
|
import '@operato/form/ox-search-form.js'
|
|
3
4
|
|
|
@@ -40,11 +41,6 @@ export class OxSelectorResourceObjectLegacy extends LitElement {
|
|
|
40
41
|
flex: 1;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
.button-container {
|
|
44
|
-
display: flex;
|
|
45
|
-
margin-left: auto;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
44
|
form {
|
|
49
45
|
position: relative;
|
|
50
46
|
}
|
|
@@ -110,10 +106,13 @@ export class OxSelectorResourceObjectLegacy extends LitElement {
|
|
|
110
106
|
</div>
|
|
111
107
|
</ox-grist>
|
|
112
108
|
|
|
113
|
-
<div class="button-container">
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
|
|
109
|
+
<div class="button-container" style="margin-left: unset;">
|
|
110
|
+
<button @click=${this.onEmpty.bind(this)}>
|
|
111
|
+
<md-icon>check_box_outline_blank</md-icon>${i18next.t('button.empty')}
|
|
112
|
+
</button>
|
|
113
|
+
<div filler></div>
|
|
114
|
+
<button @click=${this.onCancel.bind(this)}><md-icon>cancel</md-icon>${i18next.t('button.cancel')}</button>
|
|
115
|
+
<button @click=${this.onConfirm.bind(this)}><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
|
|
117
116
|
</div>
|
|
118
117
|
`
|
|
119
118
|
}
|
|
@@ -223,17 +222,17 @@ export class OxSelectorResourceObjectLegacy extends LitElement {
|
|
|
223
222
|
fieldType === 'string'
|
|
224
223
|
? 'text'
|
|
225
224
|
: numberTypes.indexOf(fieldType) >= 0
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
225
|
+
? 'number'
|
|
226
|
+
: fieldType === 'boolean'
|
|
227
|
+
? 'checkbox'
|
|
228
|
+
: fieldType,
|
|
230
229
|
queryName: selectField.queryName,
|
|
231
230
|
props:
|
|
232
231
|
fieldType === 'string'
|
|
233
232
|
? { searchOper: 'i_like' }
|
|
234
233
|
: fieldType === 'object'
|
|
235
|
-
|
|
236
|
-
|
|
234
|
+
? { searchOper: 'in' }
|
|
235
|
+
: { searchOper: 'eq' },
|
|
237
236
|
attrs: fieldType === 'boolean' ? ['indeterminated'] : []
|
|
238
237
|
}
|
|
239
238
|
})
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
1
2
|
import '@operato/data-grist'
|
|
2
3
|
|
|
3
4
|
import gql from 'graphql-tag'
|
|
@@ -47,11 +48,6 @@ export class OxSelectorResourceObject extends LitElement {
|
|
|
47
48
|
#filters > * {
|
|
48
49
|
padding: var(--padding-default) var(--padding-wide);
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
-
.button-container {
|
|
52
|
-
display: flex;
|
|
53
|
-
margin-left: auto;
|
|
54
|
-
}
|
|
55
51
|
`
|
|
56
52
|
]
|
|
57
53
|
|
|
@@ -61,7 +57,7 @@ export class OxSelectorResourceObject extends LitElement {
|
|
|
61
57
|
@property({ type: String }) queryName!: string
|
|
62
58
|
@property({ type: Object }) basicArgs: any
|
|
63
59
|
@property({ type: String }) inherited?: InheritedValueType = InheritedValueType.Include
|
|
64
|
-
@property({ type: Object }) confirmCallback?: (record?: GristRecord
|
|
60
|
+
@property({ type: Object }) confirmCallback?: (record?: Partial<GristRecord>) => void
|
|
65
61
|
@property({ type: Array }) selectedRecords: GristRecord[] = []
|
|
66
62
|
|
|
67
63
|
@property({ type: Array }) searchFields: any
|
|
@@ -97,10 +93,13 @@ export class OxSelectorResourceObject extends LitElement {
|
|
|
97
93
|
</div>
|
|
98
94
|
</ox-grist>
|
|
99
95
|
|
|
100
|
-
<div class="button-container">
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
<div class="button-container" style="margin-left: unset;">
|
|
97
|
+
<button @click=${this.onEmpty.bind(this)}>
|
|
98
|
+
<md-icon>check_box_outline_blank</md-icon>${i18next.t('button.empty')}
|
|
99
|
+
</button>
|
|
100
|
+
<div filler></div>
|
|
101
|
+
<button @click=${this.onCancel.bind(this)}><md-icon>cancel</md-icon>${i18next.t('button.cancel')}</button>
|
|
102
|
+
<button @click=${this.onConfirm.bind(this)}><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
|
|
104
103
|
</div>
|
|
105
104
|
`
|
|
106
105
|
}
|
|
@@ -114,7 +113,7 @@ export class OxSelectorResourceObject extends LitElement {
|
|
|
114
113
|
}
|
|
115
114
|
|
|
116
115
|
onEmpty() {
|
|
117
|
-
this.confirmCallback && this.confirmCallback(
|
|
116
|
+
this.confirmCallback && this.confirmCallback()
|
|
118
117
|
closePopup(this)
|
|
119
118
|
}
|
|
120
119
|
|
|
@@ -24,7 +24,19 @@ interface ArgTypes {
|
|
|
24
24
|
|
|
25
25
|
const Template: Story<ArgTypes> = ({ name = 'code', value = '' }: ArgTypes) => html`
|
|
26
26
|
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
27
|
-
<link
|
|
27
|
+
<link
|
|
28
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
29
|
+
rel="stylesheet"
|
|
30
|
+
/>
|
|
31
|
+
<link
|
|
32
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
33
|
+
rel="stylesheet"
|
|
34
|
+
/>
|
|
35
|
+
<link
|
|
36
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
37
|
+
rel="stylesheet"
|
|
38
|
+
/>
|
|
39
|
+
|
|
28
40
|
<style>
|
|
29
41
|
body {
|
|
30
42
|
}
|
package/themes/app-theme.css
CHANGED
|
@@ -82,6 +82,16 @@ body {
|
|
|
82
82
|
--mdc-button-outline-width: 1px;
|
|
83
83
|
--mdc-button-horizontal-padding: 16px;
|
|
84
84
|
|
|
85
|
+
/* material style component themes */
|
|
86
|
+
--md-theme-on-primary: var(--theme-white-color);
|
|
87
|
+
--md-theme-primary: var(--secondary-text-color);
|
|
88
|
+
--md-theme-on-secondary: var(--theme-white-color);
|
|
89
|
+
--md-theme-secondary: var(--primary-color);
|
|
90
|
+
--md-button-outline-color: var(--primary-color);
|
|
91
|
+
--md-danger-button-primary-color: var(--status-danger-color);
|
|
92
|
+
--md-danger-button-outline-color: var(--status-danger-color);
|
|
93
|
+
--md-button-outline-width: 1px;
|
|
94
|
+
|
|
85
95
|
/* button style */
|
|
86
96
|
--button-background-color: #fafbfc;
|
|
87
97
|
--button-background-focus-color: var(--primary-color);
|
package/themes/grist-theme.css
CHANGED
|
@@ -37,7 +37,7 @@ body {
|
|
|
37
37
|
|
|
38
38
|
--grid-record-background-color: var(--theme-white-color);
|
|
39
39
|
--grid-record-odd-background-color: #f9f7f5;
|
|
40
|
-
--grid-record-padding:
|
|
40
|
+
--grid-record-padding: 0 5px 0 5px;
|
|
41
41
|
--grid-record-color: var(--secondary-color);
|
|
42
42
|
--grid-record-color-hover: var(--primary-color);
|
|
43
43
|
--grid-record-wide-fontsize: var(--fontsize-small);
|